/* ==========================================================================
   DJ Freios — Triagem (pré-atendimento)
   Paleta da logo: preto, vermelho, branco e cinza. Feito primeiro para o celular.
   ========================================================================== */
:root {
  --red: #de2628;
  --red-dark: #b81c1f;
  --red-soft: rgba(222, 38, 40, 0.1);
  --black: #0b0b0c;
  --panel: #1a1a1d;
  --line: rgba(255, 255, 255, 0.12);
  --paper: #f4f4f5;
  --border: #dcdce0;
  --gray: #c4c4c6;
  --muted: #8d8d93;
  --text: #1c1c1f;
  --text-soft: #55555c;
  --ok: #1fa855;
  --font-head: "Oswald", "Arial Narrow", "Liberation Sans Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; font-family: var(--font-head); font-weight: 600; text-transform: uppercase; line-height: 1.1; letter-spacing: 0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.7rem; font-family: var(--font-head); font-weight: 500; font-size: 0.9rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); margin-bottom: 0.7rem; }
.eyebrow::before { content: ""; width: 30px; height: 3px; background: currentColor; border-radius: 2px; }

/* ---------- estrutura ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- painel da marca ---------- */
.brand { background: var(--black); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.brand::after { content: ""; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%; border: 26px solid rgba(222, 38, 40, 0.28); box-shadow: 0 0 0 26px rgba(255, 255, 255, 0.05); z-index: -1; pointer-events: none; }
.brand__inner { padding: calc(1rem + env(safe-area-inset-top)) 1.25rem 3.2rem; max-width: 560px; margin: 0 auto; }
.brand__logo { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand__logo img { width: 48px; height: 48px; }
.brand__logo span { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; }
.brand__logo small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.18em; color: var(--muted); margin-top: 0.3rem; }
.brand__copy { margin-top: 1.4rem; }
.brand__copy h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 700; }
.brand__copy p { margin-top: 0.8rem; color: var(--gray); max-width: 42ch; }
.facts, .brand__foot { display: none; }

/* ---------- área do formulário ---------- */
.panel { flex: 1; width: 100%; max-width: 640px; margin: -2rem auto 0; padding: 0 1rem calc(2rem + env(safe-area-inset-bottom)); position: relative; z-index: 2; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 1.25rem 1.1rem 1.4rem; box-shadow: 0 24px 40px -28px rgba(0, 0, 0, 0.5); }

.offline { display: flex; align-items: center; gap: 0.6rem; background: #fff4e5; border: 1px solid #f1c27d; color: #7a4a00; border-radius: 12px; padding: 0.7rem 0.9rem; margin-bottom: 0.8rem; font-size: 0.92rem; font-weight: 500; }

.service-tag { display: flex; align-items: center; gap: 0.5rem; background: var(--red-soft); color: var(--red-dark); border-radius: 10px; padding: 0.55rem 0.5rem 0.55rem 0.8rem; margin-bottom: 1rem; font-size: 0.9rem; }
.service-tag span { flex: 1; }
.service-tag button { background: none; border: 0; padding: 0.3rem; border-radius: 6px; color: inherit; display: grid; place-items: center; }

/* ---------- progresso ---------- */
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-bottom: 1.4rem; position: relative; }
.progress li { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; position: relative; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.progress li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid var(--border); display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; color: var(--muted); transition: all 0.2s; }
.progress li.is-current { color: var(--text); }
.progress li.is-current .dot { border-color: var(--red); background: var(--red); color: #fff; box-shadow: 0 0 0 4px var(--red-soft); }
.progress li.is-done { color: var(--text-soft); }
.progress li.is-done .dot { border-color: var(--red); background: #fff; color: var(--red); }
.progress li.is-done::before, .progress li.is-current::before { background: var(--red); }

/* ---------- etapas e campos ---------- */
.step h2 { font-size: 1.45rem; margin-bottom: 1rem; }
.step .lead { color: var(--text-soft); margin: -0.4rem 0 1.1rem; font-size: 0.95rem; }
.step.is-active { animation: stepIn 0.28s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.field { margin: 0 0 1.05rem; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; padding: 0; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.4rem; }
.field label small, .field legend small { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="tel"], .field input[type="date"], .field input[type="time"], .field textarea {
  width: 100%; min-height: 52px; padding: 0.75rem 0.9rem; font-size: 1rem; background: #fff; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 12px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.field input::placeholder, .field textarea::placeholder { color: #a5a5ab; }
.field input.plate { font-family: var(--font-head); font-weight: 500; font-size: 1.35rem; letter-spacing: 0.14em; text-transform: uppercase; }
.field.has-error input, .field.has-error textarea { border-color: var(--red); background: #fff8f8; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 0.35rem; }
.count { color: var(--muted); font-size: 0.78rem; text-align: right; margin-top: 0.2rem; }
.err { display: none; color: var(--red-dark); font-size: 0.86rem; font-weight: 600; margin-top: 0.4rem; }
.field.has-error > .err, .field.has-error .err { display: block; }
.err--form { background: #fff1f1; border: 1px solid #f5b5b6; border-radius: 10px; padding: 0.7rem 0.9rem; margin: 0 0 1rem; display: block; }
.row { display: flex; gap: 0.8rem; }
.row .grow { flex: 1; min-width: 0; }
.row .year { width: 6.2rem; flex: none; }
.row .time { width: 9.6rem; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- chips e opções ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { border: 1.5px solid var(--border); background: #fff; border-radius: 999px; padding: 0.6rem 0.95rem; font-size: 0.92rem; font-weight: 500; min-height: 44px; transition: all 0.15s; }
.chip:hover { border-color: var(--red); }
.chip[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓ "; color: var(--red); font-weight: 700; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.seg--stack { grid-template-columns: 1fr; }
.seg label { margin: 0; font-weight: 500; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 0.5rem 0.6rem; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; font-size: 0.93rem; line-height: 1.25; transition: all 0.15s; }
.seg--stack span { justify-content: flex-start; text-align: left; padding-left: 1rem; }
.seg input:checked + span { background: var(--black); border-color: var(--black); color: #fff; font-weight: 600; }
.seg input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.seg label:hover span { border-color: var(--red); }
.field.has-error .seg span { border-color: #f1a2a3; }

.field .check { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400 !important; font-size: 0.9rem !important; color: var(--text-soft); cursor: pointer; }
.field .check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--red); flex: none; }
.field .check a { color: var(--red-dark); font-weight: 600; }
.consent { background: var(--paper); border-radius: 12px; padding: 0.85rem 0.9rem; }
.consent.has-error { background: #fff1f1; }

/* ---------- fotos ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.6rem; }
.field .photo-add, .photo { aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; margin: 0 !important; }
.field .photo-add { border: 2px dashed var(--border); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; font-size: 0.78rem !important; font-weight: 600 !important; color: var(--text-soft); text-align: center; cursor: pointer; transition: border-color 0.15s; padding: 0.4rem; }
.field .photo-add:hover { border-color: var(--red); color: var(--red-dark); }
.field .photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.field .photo-add .icon { width: 1.9rem; height: 1.9rem; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(11, 11, 12, 0.85); color: #fff; display: grid; place-items: center; padding: 0; }
.photo button .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.photo.is-loading::after { content: ""; position: absolute; inset: 0; background: var(--paper); }
.photo.is-loading::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ---------- botões ---------- */
.actions { display: flex; gap: 0.7rem; margin-top: 1.4rem; }
.actions .btn { flex: 1; }
.actions .btn--ghost { flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 54px; padding: 0.85rem 1.3rem; border-radius: 999px; border: 2px solid transparent; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; line-height: 1; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 12px 24px -12px rgba(222, 38, 40, 0.85); }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); }
.btn--whats { background: var(--ok); color: #fff; }
.btn--whats:hover { background: #178a45; }
.btn[disabled] { opacity: 0.7; cursor: wait; transform: none; }
.spinner { display: none; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.slow { text-align: center; color: var(--text-soft); font-size: 0.85rem; margin-top: 0.8rem; }

/* ---------- confirmação ---------- */
.done { text-align: center; padding: 1.8rem 1.2rem; }
.done:focus { outline: none; }
.done__badge { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.done__badge .icon { width: 38px; height: 38px; stroke-width: 3; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done h2 { font-size: 1.7rem; }
.done .lead { color: var(--text-soft); margin: 0.6rem auto 0; max-width: 38ch; }
.proto { display: inline-block; margin: 1rem 0 1.2rem; padding: 0.35rem 0.9rem; border: 1.5px dashed var(--border); border-radius: 999px; font-size: 0.85rem; color: var(--text-soft); }
.proto b { font-family: var(--font-head); font-size: 1.05rem; letter-spacing: 0.12em; color: var(--text); margin-left: 0.3rem; }
.summary { text-align: left; background: var(--paper); border-radius: 14px; padding: 0.4rem 1rem; margin: 0 0 1.3rem; }
.summary div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); flex: none; }
.summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.done__actions { display: grid; gap: 0.7rem; }
.done .hint { margin-top: 1rem; }

.foot { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1.4rem; font-size: 0.82rem; color: var(--muted); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 380px) {
  .seg { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 0; }
  .row .year, .row .time { width: 100%; }
}

/* ---------- computador: duas colunas ---------- */
@media (min-width: 960px) {
  .shell { flex-direction: row; }
  .brand { flex: 0 0 42%; max-width: 560px; display: flex; }
  .brand::after { right: -120px; top: auto; bottom: -120px; width: 380px; height: 380px; border-width: 36px; box-shadow: 0 0 0 36px rgba(255, 255, 255, 0.05); }
  .brand__inner { padding: 3rem 3rem 2rem; max-width: none; display: flex; flex-direction: column; width: 100%; position: sticky; top: 0; min-height: 100vh; }
  .brand__logo img { width: 64px; height: 64px; }
  .brand__logo span { font-size: 1.5rem; }
  .brand__copy { margin-top: auto; }
  .brand__copy h1 { font-size: 3rem; }
  .facts { display: grid; gap: 1.1rem; margin-top: 2rem; }
  .facts li { display: flex; gap: 0.9rem; align-items: flex-start; color: var(--gray); font-size: 0.93rem; line-height: 1.4; }
  .facts .icon { color: var(--red); width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; }
  .facts b { display: block; color: #fff; font-weight: 600; }
  .brand__foot { display: block; margin-top: 2.2rem; font-size: 0.85rem; }
  .brand__foot a { color: var(--muted); text-decoration: none; }
  .brand__foot a:hover { color: #fff; }
  .panel { margin: 0; max-width: none; padding: 3rem 3rem 2rem; display: flex; flex-direction: column; justify-content: center; align-items: center; }
  .panel > * { width: 100%; max-width: 560px; }
  .card { padding: 2rem 2rem 2.2rem; }
  .step h2 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
