/* Etapa 1 · Diagnóstico dos Sócios · CEC Care (Cuidados em Casa) */

@font-face { font-family: "Oswald"; src: url("/assets/fonts/oswald-var.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Cores da CEC Care (azul-marinho + dourado) */
  --navy: #2c4562;
  --navy-ink: #22364e;
  --navy-mid: #6a82a0;
  --gold: #c2a574;
  --gold-hover: #b39463;
  --gold-ink: #866838;
  --sand: #f4efe7;
  --sand-line: #e4dacb;
  --on-navy: #dce3ec;
  --ink: #1f2a36;
  --muted: #4e5966;
  --line: #e3ded6;
  --field: #fbf9f6;
  --error: #b42318;
  --error-bg: #fef4f3;
  --focus: var(--gold-ink);
  --gutter: 16px;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; scrollbar-color: var(--navy) var(--sand); }
body { margin: 0; background: var(--sand); color: var(--ink); font: 400 1.0625rem/1.55 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, fieldset, legend { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
a { color: var(--navy-ink); text-underline-offset: 3px; }
::selection { background: var(--navy); color: #fff; }
textarea, input, select, button { font: inherit; color: inherit; }
textarea, input { caret-color: var(--navy); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1080px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { width: min(800px, 100% - 2 * var(--gutter)); }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -120px; z-index: 50; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 16px; }

/* ---------- Topo ---------- */
.brandbar { background: #fff; border-bottom: 1px solid var(--line); }
.brandbar__row { display: flex; justify-content: center; padding: max(14px, env(safe-area-inset-top)) 0 14px; }
.logo { height: 44px; width: auto; }

.hero {
  color: #fff; padding: 36px 0 92px; position: relative; overflow: hidden;
  /* azul da marca com o brilho dourado das peças da CEC Care */
  background:
    radial-gradient(70% 90% at 100% 100%, rgb(194 165 116 / 0.42), transparent 70%),
    radial-gradient(60% 70% at 0% 0%, rgb(255 255 255 / 0.06), transparent 70%),
    var(--navy);
}
.hero__inner { position: relative; text-align: center; }
.hero__pill { display: inline-block; background: var(--gold); color: var(--navy-ink); font: 600 1.15rem/1.15 var(--display); letter-spacing: 0.05em; text-transform: uppercase; padding: 0.55em 1em; border-radius: 999px; }
.hero__title { margin-top: 26px; }
.hero__logo { width: clamp(210px, 62vw, 300px); height: auto; margin-inline: auto; }
.hero__sub { margin-top: 18px; font-size: clamp(1.1rem, 3.4vw, 1.4rem); font-weight: 500; color: var(--on-navy); text-wrap: balance; }

/* ---------- Introdução ---------- */
.main { padding-bottom: 64px; }
.intro {
  position: relative; z-index: 1; margin-top: -56px;
  background: #fff; border-radius: 20px; padding: 26px 20px;
  box-shadow: 0 20px 40px -28px rgb(34 54 78 / 0.45);
}
.intro__title { font: 600 1.6rem/1.1 var(--display); text-transform: uppercase; color: var(--gold-ink); }
.intro > p { margin-top: 12px; color: var(--muted); }
.privacy { margin-top: 20px; padding: 16px 18px; background: var(--sand); border-radius: 14px; }
.privacy__title { display: flex; align-items: center; gap: 8px; font: 600 1.05rem/1.2 var(--text); color: var(--navy-ink); }
.privacy ul { margin-top: 10px; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.975rem; color: var(--ink); }
.intro__tips { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px !important; font-size: 0.95rem; color: var(--muted); }
.intro__tips .icon { color: var(--navy); margin-top: 2px; }

/* ---------- Cartão do questionário ---------- */
.card {
  margin-top: 20px; background: #fff; border-radius: 20px;
  padding: 0 18px 22px; border: 1px solid var(--sand-line);
  box-shadow: 0 24px 48px -32px rgb(34 54 78 / 0.5); outline: none; overflow: clip;
}
.progress { height: 6px; margin: 0 -18px; background: var(--sand); }
.progress__bar { height: 100%; width: 10%; background: var(--gold); border-radius: 0 999px 999px 0; transition: width 0.4s var(--ease-out); }
.stepinfo { margin-top: 18px; font: 600 0.95rem/1 var(--text); color: var(--muted); letter-spacing: 0.02em; }
.restore { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-top: 14px; padding: 10px 14px; background: #fbf7f0; border: 1px solid var(--sand-line); border-radius: 10px; font-size: 0.925rem; }

.step__head { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.step__num { flex-shrink: 0; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--navy); color: var(--gold); font: 600 1.3rem/1 var(--display); }
.step__title { font: 600 1.55rem/1.1 var(--display); text-transform: uppercase; color: var(--navy-ink); text-wrap: balance; }
.step__lead { margin-top: 12px; color: var(--muted); }

.legend {
  position: sticky; top: 0; z-index: 2;
  margin: 18px -18px 0; padding: 10px 18px;
  background: rgb(255 255 255 / 0.96); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: var(--muted);
}
.legend b { color: var(--navy-ink); font-family: var(--display); font-weight: 600; margin-right: 3px; }

/* Afirmação com escala */
.sc { padding: 18px 0; border-bottom: 1px solid var(--line); }
.sc__q { display: flex; gap: 10px; font-weight: 500; line-height: 1.45; }
.sc__cod { flex-shrink: 0; font: 600 0.95rem/1.5 var(--display); color: var(--navy); min-width: 2.2em; }
.sc__opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.sc__na { margin-top: 6px; }
.pick { position: relative; display: block; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pick__box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; padding: 6px 4px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.pick__n { font: 600 1.2rem/1 var(--display); color: var(--navy-ink); }
.pick__l { display: none; font-size: 0.75rem; line-height: 1.15; color: var(--muted); }
.sc__na .pick__box { min-height: 40px; flex-direction: row; font-size: 0.9rem; color: var(--muted); }
.pick:hover .pick__box { border-color: var(--navy-mid); background: #f7f9fb; }
.pick input:checked + .pick__box { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 8px 16px -12px rgb(34 54 78 / 0.9); }
.pick input:checked + .pick__box .pick__n, .pick input:checked + .pick__box .pick__l { color: #fff; }
.sc__na .pick input:checked + .pick__box { background: var(--muted); border-color: var(--muted); }
.pick input:focus-visible + .pick__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.sc__ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.75rem; color: var(--muted); }
.sc[aria-invalid="true"] .pick__box { border-color: #f1b8b2; }

/* Campos */
.field { margin-top: 18px; }
.field label, .field .label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 1rem; color: var(--ink); line-height: 1.4; }
.field .label-cod { font-family: var(--display); color: var(--navy); margin-right: 6px; }
.field .opt { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.field input[type="text"], .field select, .field textarea {
  display: block; width: 100%;
  font-size: 1.0625rem; background: var(--field);
  border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-appearance: none; appearance: none;
}
.field input[type="text"], .field select { height: 52px; padding: 0 14px; }
.field select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322364e' 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 14px center; background-size: 20px;
}
.field select:invalid { color: #6b7380; }
.field textarea { min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6b7380; opacity: 1; }
.field :is(input, select, textarea):hover { border-color: var(--navy-mid); }
.field :is(input, select, textarea):focus { outline: none; background: #fff; border-color: var(--navy); box-shadow: 0 0 0 4px rgb(106 130 160 / 0.25); }
.field [aria-invalid="true"] { border-color: var(--error) !important; background: var(--error-bg); }
.err { margin-top: 6px; font-size: 0.9rem; font-weight: 600; color: var(--error); }
.err:empty { display: none; }

.opens { margin-top: 8px; }
.opens__title { margin-top: 26px; font: 600 1.05rem/1.2 var(--text); color: var(--navy-ink); }

.case { margin-top: 22px; padding: 18px; border: 1px solid var(--sand-line); border-radius: 14px; }
.case__title { font: 600 1.15rem/1.2 var(--display); text-transform: uppercase; color: var(--navy-ink); }
.case__sit { margin-top: 8px; padding: 10px 12px; background: var(--sand); border-radius: 10px; font-size: 0.975rem; }
.case .field { margin-top: 12px; }

.consent { margin-top: 24px; padding: 16px; background: var(--sand); border-radius: 12px; }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; font-size: 0.975rem; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); cursor: pointer; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 14px; background: var(--error-bg); border: 1px solid #f7cfca; border-radius: 10px; color: #8f1d14; font-size: 0.95rem; font-weight: 500; }

/* Navegação */
.nav { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  font: 600 1.1rem/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn--primary { flex: 1; border: 0; background: var(--gold); color: var(--navy-ink); box-shadow: 0 12px 22px -14px rgb(134 104 56 / 0.7); }
.btn--primary:hover { background: var(--gold-hover); }
.btn--primary:active { transform: translateY(1px); }
.btn--ghost { border: 1.5px solid var(--line); background: #fff; color: var(--navy-ink); }
.btn--ghost:hover { border-color: var(--navy-mid); }
.btn--submit[aria-busy="true"] { cursor: progress; background: var(--gold-hover); }
.btn__busy { display: none; width: 18px; height: 18px; border: 2.5px solid rgb(34 54 78 / 0.3); border-top-color: var(--navy-ink); border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn--submit[aria-busy="true"] .btn__busy { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--navy-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.step { animation: stepin 0.45s var(--ease-out) both; }
@keyframes stepin { from { opacity: 0; transform: translateY(8px); } }

/* Enviado */
.done { text-align: center; padding: 28px 4px 8px; outline: none; }
.done__mark { width: 80px; height: 80px; margin: 0 auto 18px; }
.done__ring, .done__tick { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done__ring { stroke: var(--gold); stroke-width: 3; stroke-dasharray: 183; }
.done__tick { stroke: var(--navy); stroke-width: 4.5; stroke-dasharray: 40; }
.done.is-in .done__ring { animation: draw-ring 0.8s var(--ease-out) both; }
.done.is-in .done__tick { animation: draw-tick 0.5s var(--ease-out) 0.35s both; }
@keyframes draw-ring { from { stroke-dashoffset: 183; } }
@keyframes draw-tick { from { stroke-dashoffset: 40; } }
.done__title { font: 600 1.9rem/1.05 var(--display); text-transform: uppercase; color: var(--navy-ink); }
.done__text { margin: 10px auto 0; max-width: 44ch; color: var(--muted); font-size: 1.1rem; }

.footer { background: #fff; border-top: 1px solid var(--line); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); font-size: 0.925rem; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .logo { height: 52px; }
  .hero { padding: 48px 0 108px; }
  .hero__logo { width: 340px; }
  .intro { padding: 32px 36px; }
  .card { padding: 0 36px 30px; }
  .progress, .legend { margin-inline: -36px; }
  .legend { padding-inline: 36px; }
  .pick__box { min-height: 62px; }
  .pick__l { display: block; }
  .sc__ends { display: none; }
  .sc__na { max-width: 320px; }
  .btn--primary { flex: 0 1 260px; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .btn__busy { animation: spin 1.6s linear infinite !important; }
}
