/* ============================================================
   TRIAGEM 360° — formulário interativo (uma pergunta por vez)
   ID visual padrão do domínio (§3.2): dark navy da /consulta ·
   azul = método/ação · âmbar = alerta · verde = só WhatsApp
   ============================================================ */

:root {
  --navy:        #0a1628;
  --navy-2:      #0c1422;
  --navy-3:      #0f1b2d;
  --navy-card:   #122036;
  --navy-card-2: #16263f;

  --blue:      #1e90ff;
  --blue-soft: #4fb0ff;
  --blue-deep: #0a4d96;
  --blue-glow: #1e90ff55;
  --warn:      #f5b048;
  --whatsapp:  #25d366;

  --text:   #e8eef7;
  --text-2: #a6b3c7;
  --text-3: #7d8ba3;

  --line:   #ffffff14;
  --line-2: #ffffff0d;

  --font-display: "Fraunces", "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--text);
  line-height: 1.6;
  display: flex; flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* gradientes radiais sutis + noise (assinatura do domínio) */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 600px at 85% -5%, #1e90ff10, transparent 60%),
    radial-gradient(700px 500px at -10% 100%, #f5b04806, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}

.mono { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--blue-glow); color: #fff; }

/* ---------- Barra superior ---------- */
.bar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 18px;
  padding: 16px min(4vw, 32px);
  border-bottom: 1px solid var(--line-2);
  background: #0a1628d9;
}
.brand { text-decoration: none; color: inherit; }
.brand-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.brand-name em { font-style: italic; font-weight: 400; color: var(--blue-soft); }
.bar-progress {
  flex: 1; height: 4px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.bar-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--blue-soft));
  border-radius: 999px;
}
.bar-meta { white-space: nowrap; }

/* ---------- Palco ---------- */
.stage {
  position: relative; z-index: 1;
  flex: 1; display: grid; place-items: center;
  padding: 24px min(6vw, 64px);
  overflow: hidden;
}
.card {
  width: min(680px, 100%);
  will-change: transform, opacity;
}
.q-block { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.q-block .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.q-num { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-soft); }
.q-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.9vw, 2.4rem);
  line-height: 1.15; letter-spacing: -.01em; text-wrap: balance;
}
.q-text { color: var(--text-2); margin-top: 14px; max-width: 58ch; }
.q-text strong { color: var(--text); }
/* callout de aviso: tint + borda completa (side-stripe é banido no domínio) */
.q-aviso {
  font-size: .82rem; color: var(--text-2);
  background: #f5b04810; border: 1px solid #f5b04833; border-radius: 10px;
  padding: 12px 16px; margin-top: 22px; max-width: 56ch;
}
.q-erro { color: #ff9d7a; font-size: .9rem; margin-top: 12px; display: none; }
.q-erro.on { display: block; }
.q-erro a { color: var(--whatsapp); }

/* intro de instrumento */
.q-instr {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--warn);
  border: 1px solid #f5b04850; border-radius: 6px;
  display: block; width: fit-content; padding: 6px 10px; margin-bottom: 16px;
}

/* ---------- Opções (choice / scale) ---------- */
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--navy-card); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; font-family: var(--font-body); font-size: 1rem;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.opt:hover { border-color: var(--blue); transform: translateX(3px); }
.opt .key {
  flex: none; width: 26px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  border: 1px solid var(--line); color: var(--text-3); background: var(--navy-2);
  transition: all .2s ease;
}
.opt.sel { border-color: var(--blue); background: #1e90ff14; }
.opt.sel .key { background: var(--blue); border-color: var(--blue); color: #fff; }

/* checklist de múltipla seleção (MASM/SASM) — quadrado em vez de letra */
.opt--check:hover { transform: none; }
.opt--check .chk {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--line); background: var(--navy-2);
  transition: all .2s ease; position: relative;
}
.opt--check.sel .chk { background: var(--blue); border-color: var(--blue); }
.opt--check.sel .chk::after {
  content: ""; position: absolute; left: 50%; top: 46%;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ---------- Inputs ---------- */
.field { margin-top: 28px; }
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem);
  color: var(--text); background: transparent;
  border: 0; border-bottom: 2px solid var(--line);
  padding: 8px 2px 12px; border-radius: 0;
  transition: border-color .25s ease;
}
.field textarea { font-size: clamp(1.1rem, 1rem + .6vw, 1.35rem); line-height: 1.5; resize: none; min-height: 120px; }
/* placeholder precisa dos mesmos 4.5:1 do corpo (WCAG); #57647c dava 3.0 */
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); font-style: italic; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--blue); }

/* ---------- Slider (MDS-16) ---------- */
.slider-field { margin-top: 40px; }
.slider-readout {
  font-family: var(--font-display); font-style: italic; font-size: 2.6rem;
  color: var(--blue-soft); text-align: center; margin-bottom: 22px; line-height: 1;
}
.slider-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 999px;
  background: var(--line);
  outline: none; cursor: pointer;
}
.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff;
  box-shadow: 0 4px 14px -2px var(--blue-glow);
  cursor: grab; transition: transform .15s ease;
}
.slider-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.12); }
.slider-range::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff;
  box-shadow: 0 4px 14px -2px var(--blue-glow); cursor: grab;
}
.slider-range::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }
.slider-track-labels {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 16px; font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .04em; color: var(--text-3);
}
.slider-track-labels span { max-width: 46%; }
.slider-track-labels span:last-child { text-align: right; }

.actions { display: flex; align-items: center; gap: 16px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem;
  color: #fff; background: var(--blue);
  border: 1px solid var(--blue); border-radius: 999px;
  padding: 13px 28px; cursor: pointer; text-decoration: none;
  transition: background .25s ease, transform .25s ease;
  box-shadow: 0 10px 30px -14px var(--blue-glow);
}
.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); transform: translateY(-1px); }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }
.btn-ghost { background: transparent; border-color: var(--line); box-shadow: none; color: var(--blue-soft); }
.btn-ghost:hover { background: #1e90ff14; border-color: var(--blue-deep); }
.actions .hint { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; color: var(--text-3); }

/* ---------- Rodapé ---------- */
.deck {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px min(4vw, 32px);
  border-top: 1px solid var(--line-2);
}
.deck-hint { letter-spacing: .06em; text-transform: none; }
.deck-nav { display: flex; gap: 8px; }
.nav-btn {
  width: 42px; height: 42px; border-radius: 10px;
  font-size: 1.1rem; color: var(--blue-soft);
  background: var(--navy-card); border: 1px solid var(--line);
  cursor: pointer; transition: all .2s ease;
}
.nav-btn:hover { border-color: var(--blue); background: #1e90ff14; }
.nav-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }

/* ---------- Tela final ---------- */
.done-ring {
  width: 74px; height: 74px; margin-bottom: 26px;
}
.done-ring circle { fill: none; stroke-width: 3; }
.done-ring .bg { stroke: var(--line); }
.done-ring .fg { stroke: var(--blue-soft); stroke-linecap: round; }
.done-ring .check { stroke: var(--blue-soft); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px);
  background: var(--navy-card-2); color: var(--text);
  border: 1px solid var(--line);
  font-size: .88rem; padding: 13px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; z-index: 100;
  transition: opacity .3s ease, transform .3s ease;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .bar-meta { display: none; }
  .deck-hint { display: none; }
  .stage { padding: 20px 6vw; align-items: start; padding-top: 8vh; }
  .stage .card { align-self: start; }
}

/* ---------- Link do professor (tela de sucesso do infantil) ---------- */
.prof-link {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.prof-url {
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: .85rem;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
