/* ==========================================================================
   Pedido de serviço em janela: diálogo centrado sobre a página desfocada
   (The Org "Contact sales"), passos numerados em mono, pílulas de múltipla
   escolha (Intercom) e seletor de serviços com escolhidos no topo (Hashnode).
   Magenta só no botão de envio e no estado escolhido, como no resto do site.
   ========================================================================== */

.req {
  width: min(100% - 2rem, 46rem); max-height: min(92vh, 60rem); padding: 0; border: 0;
  border-radius: var(--radius-surface); background: var(--surface); color: var(--ink);
  box-shadow: 0 32px 80px rgb(0 0 0 / 0.35); overflow: hidden;
}
.req::backdrop { background: rgb(30 30 30 / 0.55); backdrop-filter: blur(6px); }
.req[open] { animation: req-in var(--duration-slow) var(--ease-out); }
@keyframes req-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.req-box { display: grid; grid-template-rows: auto 1fr; max-height: min(92vh, 60rem); }

.req-head {
  display: flex; justify-content: space-between; align-items: start; gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem; background: var(--ink); color: #f8f8f8;
}
.req-kicker { color: var(--ash); font-size: 0.75rem; text-transform: uppercase; margin-bottom: 0.5rem; }
.req-title { font-family: var(--font-display); font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); line-height: 1; letter-spacing: -0.02em; }
.req-context { margin-top: 0.625rem; color: #d6d6d6; font-size: 0.9375rem; }
.req-close { color: #f8f8f8; border-color: rgb(248 248 248 / 0.3); }
.req-close:hover { border-color: #fff; background: rgb(248 248 248 / 0.08); }

.req-body { overflow-y: auto; overscroll-behavior: contain; }
.req-form { display: grid; grid-template-columns: minmax(0, 1fr); }
.req-step { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 0.875rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.req-step__title { font-family: var(--font-head); font-weight: 700; font-size: 1.0625rem; }
.req-step__title .mono { color: var(--accent); font-size: 0.8125rem; margin-right: 0.25rem; }
.req-optional, .req-required { font-family: var(--font-body); font-weight: 400; font-size: 0.8125rem; color: var(--muted); }
.req-required { color: var(--accent-hover); }

/* Tipo de pedido: pílulas que ligam e desligam. */
.req-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.req-pill {
  min-height: 2.5rem; padding: 0 1rem; border-radius: var(--radius-pill); border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink); font-weight: 600; font-size: 0.9375rem;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.req-pill:hover { border-color: var(--ink); }
.req-pill[aria-pressed="true"] { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-hover); }

/* Seletor de serviços. */
.req-picker { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.625rem; }
.req-search {
  display: flex; align-items: center; gap: 0.625rem; padding: 0 0.875rem; min-height: 3rem;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.req-search:focus-within { border-color: var(--ink); }
.req-search svg { width: 1.125rem; height: 1.125rem; color: var(--muted); flex: none; }
.req-search input { flex: 1; min-width: 0; min-height: 2.75rem; border: 0; background: transparent; outline: none; font-size: 1rem; }
.req-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.req-chips:empty { display: none; }
.req-chip {
  display: inline-flex; align-items: center; gap: 0.375rem; max-width: 100%; padding: 0.375rem 0.5rem 0.375rem 0.75rem;
  border: 0; border-radius: var(--radius-pill); background: var(--ink); color: #f8f8f8; font-size: 0.875rem; font-weight: 600; text-align: left;
}
.req-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-chip svg { width: 0.875rem; height: 0.875rem; flex: none; opacity: 0.75; }
.req-chip:hover svg { opacity: 1; }
.req-status { color: var(--muted); font-size: 0.75rem; }
.req-status:empty { display: none; }
.req-options { list-style: none; padding: 0; max-height: 15rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.req-options:empty { display: none; }
.req-options li + li { border-top: 1px solid var(--line); }
.req-option { display: flex; gap: 0.75rem; align-items: start; padding: 0.625rem 0.875rem; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out); }
.req-option:hover { background: var(--bg); }
.req-option input { margin-top: 0.25rem; width: 1.125rem; height: 1.125rem; accent-color: var(--accent); flex: none; }
.req-option__body { display: grid; gap: 0.125rem; }
.req-option__name { font-weight: 600; line-height: 1.35; }
.req-option__meta { color: var(--muted); font-size: 0.75rem; }

/* Campos. */
.req-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.375rem; align-content: start; min-width: 0; }
.req-field label { font-weight: 600; font-size: 0.9375rem; }
.req-field input, .req-field textarea {
  width: 100%; min-height: 2.875rem; padding: 0.625rem 0.875rem; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; transition: border-color var(--duration-fast) var(--ease-out);
}
.req-field textarea { resize: vertical; min-height: 7.5rem; line-height: 1.5; }
.req-field input:focus, .req-field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(30 30 30 / 0.08); }
.req-field [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgb(235 0 4 / 0.12); }
.req-hint { color: var(--muted); font-size: 0.8125rem; }
.req-error { color: var(--error); font-size: 0.8125rem; font-weight: 600; }
.req-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem 1rem; }

.req-foot { display: grid; gap: 0.75rem; padding: 1.25rem 1.5rem 1.5rem; }
.req-note { color: var(--muted); font-size: 0.875rem; }
.req-error--form { padding: 0.75rem 1rem; border-radius: 12px; background: #fdecec; }
.req-submit { justify-self: stretch; }
.req-submit svg { width: 1.125rem; height: 1.125rem; }
.req-submit:disabled { opacity: 0.7; cursor: progress; }

/* Confirmação. */
.req-done { display: grid; justify-items: center; gap: 0.875rem; padding: 3rem 1.5rem; text-align: center; }
.req-done__mark { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--success); color: #fff; }
.req-done__mark svg { width: 1.75rem; height: 1.75rem; stroke-width: 2.5; }
.req-done__list { list-style: none; padding: 0; color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 600px) {
  .req { width: 100%; max-height: 100dvh; border-radius: var(--radius-surface) var(--radius-surface) 0 0; margin: auto auto 0; }
  .req-box { max-height: 100dvh; }
  .req-grid { grid-template-columns: minmax(0, 1fr); }
  .req-head, .req-step, .req-foot { padding-inline: 1rem; }
}
