/* Wendell Mota Seguros — formulário de seguro auto.
   Mesmo visual do formulário de cotação de plano de saúde: marinho institucional
   sobre branco levemente acinzentado. As cores da marca são tokens: para trocar a
   identidade, mude só o bloco --brand abaixo. */

:root {
  --brand-primary: #16254C;
  --brand-primary-deep: #0E1A38;
  --brand-secondary: #C99A6B; /* dourado da logo */
  --brand-background: #F7F8FB;
  --brand-surface: #FFFFFF;
  --brand-text: #16254C;
  --brand-body: #55607A;
  --brand-muted: #7A8398;
  --brand-border: #E3E7F0;
  --brand-tint: #EEF1F7;
  --brand-tint-line: #C9D2E4;
  --brand-success: #1F7A4D;
  --brand-error: #B4323C;
  --brand-placeholder: #A6AEC0;
  --brand-focus-ring: rgba(22, 37, 76, .10);
  --brand-on-primary: #FFFFFF;

  /* Aliases internos — o resto do arquivo usa estes nomes. */
  --navy: var(--brand-primary);
  --navy-deep: var(--brand-primary-deep);
  --navy-tint: var(--brand-tint);
  --navy-line: var(--brand-tint-line);
  --ink: var(--brand-text);
  --body: var(--brand-body);
  --muted: var(--brand-muted);
  --line: var(--brand-border);
  --paper: var(--brand-surface);
  --shell: var(--brand-background);
  --error: var(--brand-error);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 37, 76, .05);
  --shadow-lift: 0 10px 34px rgba(22, 37, 76, .10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--shell);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--shell); overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Estrutura */
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.form-shell {
  width: min(680px, 100%);
  margin: auto;
  padding: 30px clamp(20px, 5vw, 40px) calc(48px + env(safe-area-inset-bottom, 0px));
}

/* Progresso */
.progress-track {
  position: fixed; inset: 0 0 auto; z-index: 5;
  height: 3px; background: var(--line);
}
.progress-track span {
  display: block; height: 100%; width: 0;
  background: var(--navy);
  transition: width .35s ease;
}

/* Marca.
   A logo é dourada e foi desenhada sobre fundo escuro, por isso ela vive dentro
   de um bloco marinho: sobre o fundo claro do formulário o dourado perderia
   contraste e a marca ficaria lavada. */
.brand { display: flex; justify-content: center; padding: 14px 0 30px; }
.brand-badge {
  display: grid; place-items: center;
  background: var(--navy);
  border-radius: 18px;
}
.brand-badge img { display: block; height: auto; }

.brand-badge-mark { width: 74px; height: 74px; border-radius: 16px; }
.brand-badge-mark img { width: 40px; }

.brand-full { padding-bottom: 26px; }
.brand-full .brand-badge { width: 148px; padding: 26px 22px; border-radius: 22px; }
.brand-full .brand-badge img { width: 104px; }

/* Tipografia */
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -.022em; line-height: 1.16; color: var(--ink); }
h1 { font-size: clamp(30px, 4.6vw, 40px); }
h2 { font-size: clamp(23px, 3.4vw, 29px); }
.lead, .hint { color: var(--body); font-size: 15px; line-height: 1.65; }
.hint { margin: 12px 0 0; }

/* Capa */
.intro { text-align: center; }
.intro .lead { max-width: 460px; margin: 16px auto 30px; }
.intro > small { display: block; margin-top: 14px; color: var(--muted); font-size: 12px; }
.trust-note {
  display: flex; gap: 10px; align-items: flex-start;
  max-width: 460px; margin: 34px auto 0; padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted); text-align: left;
}
.trust-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--navy); }
.trust-note p { margin: 0; font-size: 12px; line-height: 1.55; }

/* Botões */
.primary {
  width: 100%; min-height: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  color: var(--brand-on-primary); background: var(--navy);
  border: 1px solid var(--navy); border-radius: 12px;
  font-size: 15px; font-weight: 600; letter-spacing: .005em;
  transition: background .18s ease, transform .18s ease, opacity .18s ease;
}
.primary:hover:not(:disabled) { background: var(--navy-deep); transform: translateY(-1px); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.intro .primary { max-width: 340px; margin-inline: auto; }

.step-nav { margin-top: 30px; }

/* Cabeçalho da etapa */
.step-row {
  display: flex; align-items: center;
  min-height: 40px;
  margin-bottom: 18px;
  color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
}
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 40px; margin-left: -8px; padding: 0 10px 0 4px;
  color: var(--navy); background: transparent; border: 0; border-radius: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { background: var(--navy-tint); }

/* Cards de escolha */
.options { display: grid; gap: 10px; margin-top: 26px; }
.option {
  width: 100%; min-height: 66px; padding: 14px 16px;
  display: grid; grid-template-columns: 32px 1fr 24px; align-items: center; gap: 13px;
  text-align: left;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.option-label { font-size: 15.5px; font-weight: 500; line-height: 1.35; }
.option-label small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 400; }
.option i {
  width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--navy); background: var(--navy-tint);
  border-radius: 9px;
  font-size: 12.5px; font-weight: 600; font-style: normal;
}
.option i.option-icon svg { width: 18px; height: 18px; }
.option b {
  width: 22px; height: 22px; display: grid; place-items: center;
  color: transparent; background: transparent;
  border: 1.5px solid var(--navy-line); border-radius: 50%;
  font-size: 11px;
}
.option:hover { border-color: var(--navy-line); transform: translateY(-1px); }
.option[aria-pressed="true"] {
  border-color: var(--navy); background: var(--navy-tint);
  box-shadow: 0 0 0 1px var(--navy) inset;
}
.option[aria-pressed="true"] i { color: var(--brand-on-primary); background: var(--navy); }
.option[aria-pressed="true"] b { color: var(--brand-on-primary); background: var(--navy); border-color: var(--navy); }

/* Campos */
.field { display: grid; gap: 8px; margin-top: 22px; }
.field > span { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.field input {
  width: 100%; height: 56px; padding: 0 16px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input::placeholder { color: var(--brand-placeholder); }
.field input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--brand-focus-ring); }
.field input[aria-invalid="true"] { border-color: var(--error); }

.field + .field, datalist + .field { margin-top: 16px; }

/* Ano: anos recentes em cards de toque, antigos na lista nativa. */
.years {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin-top: 26px;
}
.year-chip {
  min-height: 52px; padding: 0 8px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.year-chip:hover { border-color: var(--navy-line); transform: translateY(-1px); }
.year-chip[aria-pressed="true"] {
  color: var(--brand-on-primary); background: var(--navy); border-color: var(--navy);
}
.field-select { margin-top: 20px; }
.field select {
  width: 100%; height: 56px; padding: 0 44px 0 16px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  outline: 0; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316254C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
  font-size: 16px;
}
.field select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--brand-focus-ring); }

/* WhatsApp na tela final */
.whatsapp-cta { max-width: 340px; margin: 28px auto 0; text-decoration: none; }
.whatsapp-cta svg { width: 18px; height: 18px; }

/* Aviso de redirecionamento para o WhatsApp (tela final) */
.redirect-note {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 18px !important;
  color: var(--muted) !important; font-size: 13.5px !important;
}
.redirect-note .spinner { flex: none; width: 16px; height: 16px; margin: 0; border-width: 2px; }

/* Estados */
.error {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 0; color: var(--error); font-size: 13.5px; font-weight: 500;
}
.error svg { flex: none; width: 15px; height: 15px; }

.spinner-inline { width: 18px; height: 18px; margin: 0; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: var(--brand-on-primary); }
.analyzing { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.spinner {
  width: 42px; height: 42px; margin-bottom: 24px;
  border: 3px solid var(--navy-line); border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.analyzing p { margin: 12px 0 0; color: var(--body); font-size: 15px; }

.completion { text-align: center; }
.completion-card {
  padding: clamp(34px, 6vw, 50px) clamp(22px, 5vw, 42px);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lift);
}
/* O visto é azul da marca, e não verde: a tela inteira vive do navy, e a
   palavra "Recebemos" já diz que deu certo — o verde só acrescentava uma
   terceira cor que não é de ninguém. */
.check {
  width: 60px; height: 60px; display: grid; place-items: center;
  margin: 0 auto 24px;
  color: var(--brand-on-primary); background: var(--navy); border-radius: 50%;
}
.check svg { width: 28px; height: 28px; }
.completion-card p { max-width: 400px; margin: 12px auto 0; color: var(--body); font-size: 15px; line-height: 1.65; }

.animate { animation: enter .3s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .animate, .spinner { animation: none; }
  .primary:hover:not(:disabled), .option:hover, .year-chip:hover { transform: none; }
  .progress-track span { transition: none; }
}

/* Mobile */
@media (min-width: 520px) {
  .years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .form-shell { padding: 26px 18px calc(40px + env(safe-area-inset-bottom, 0px)); }
  .brand { padding: 8px 0 24px; }
  .brand-badge-mark { width: 66px; height: 66px; }
  .brand-badge-mark img { width: 36px; }
  .brand-full .brand-badge { width: 132px; padding: 22px 18px; }
  .brand-full .brand-badge img { width: 92px; }
  h1 { font-size: 29px; }
  h2 { font-size: 23px; }
  .lead, .hint { font-size: 15px; }
  .option { min-height: 68px; grid-template-columns: 30px 1fr 22px; gap: 11px; }
  .option-label { font-size: 15px; }
  .field input { font-size: 16px; }
  .step-nav { margin-top: 26px; }
}

@media (max-width: 360px) {
  .form-shell { padding-inline: 16px; }
  .option { padding: 12px 13px; gap: 10px; }
  .option-label { font-size: 14.5px; }
}
