/* ==========================================================================
   Bazana Design — Diagnóstico
   Tokens extraídos de claude/design-system-fundacoes.md (projeto BazanaDesign)
   ========================================================================== */

:root {
  /* Cor — apenas os valores documentados no design system */
  --primary-500: #319871;   /* verde — principal sobre fundo preto */
  --primary-900: #144032;   /* verde escuro — situacional */
  --neutral-950: #121212;   /* preto — fundo institucional */
  --neutral-50:  #FAFAFA;   /* branco — texto principal sobre preto */

  /* Superfícies derivadas (opacidade sobre neutral-950, não é token de marca) */
  --surface-1: rgba(250, 250, 250, 0.03);
  --surface-2: rgba(250, 250, 250, 0.06);
  --border-subtle: rgba(250, 250, 250, 0.10);
  --border-strong: rgba(250, 250, 250, 0.18);
  --text-muted: rgba(250, 250, 250, 0.58);
  --text-faint: rgba(250, 250, 250, 0.36);
  --focus-ring: rgba(49, 152, 113, 0.45);

  /* Tipografia */
  --font-display: 'Merriweather', serif;
  --font-body: 'Open Sans', sans-serif;

  /* Espaçamento — escala 4·8·12·16·24·32·40·56·64 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 56px;
  --space-9: 64px;

  /* Raio — 8·16·24·full */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--neutral-950);
  color: var(--neutral-50);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Atmosfera de fundo — mesh sutil em verde + grain, sóbrio (não decorativo demais) */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 900px 600px at 12% -10%, rgba(49, 152, 113, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 105%, rgba(49, 152, 113, 0.10), transparent 60%);
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) clamp(24px, 6vw, 96px) var(--space-9);
}

.content-col {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.logo {
  height: 44px;
  width: auto;
  display: block;
}

.header-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Intro / Hero ---------- */
.intro {
  display: none;
  margin-bottom: var(--space-8);
}

.intro.is-active {
  display: block;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-8);
  align-items: center;
}

.intro-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.intro-main h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 52px;
  line-height: 58px;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.intro-lead {
  font-size: 19px;
  line-height: 30px;
  color: var(--text-muted);
  margin: 0;
  max-width: 42ch;
}

.btn-start {
  margin-top: var(--space-2);
}

.intro-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-5);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--primary-500);
  border-radius: var(--radius-md);
}

.stat-card strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 32px;
  color: var(--neutral-50);
}

.stat-card span {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Form shell ---------- */
.form-shell {
  display: none;
  flex-direction: column;
  flex: 1;
}

.form-shell.is-active {
  display: flex;
}

.progress-track {
  height: 2px;
  width: 100%;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-500);
  transition: width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.progress-label {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: var(--space-7);
  display: flex;
  justify-content: space-between;
}

.step {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: step-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.step.is-active {
  display: flex;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-500);
  margin: 0 0 var(--space-3);
}

.step-question {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 28px;
  line-height: 36px;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}

.step-hint {
  font-size: 14px;
  color: var(--text-faint);
  margin: 0 0 var(--space-6);
}

.step-body {
  margin-bottom: var(--space-6);
}

/* Campo de texto */
.field-text {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  color: var(--neutral-50);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.4;
  padding: var(--space-3) 0;
  outline: none;
  transition: border-color 0.2s ease;
}

.field-text::placeholder {
  color: var(--text-faint);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
}

.field-text:focus {
  border-color: var(--primary-500);
}

/* Cards de opção (single/multi choice) */
.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.option-card {
  position: relative;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  cursor: pointer;
  font-size: 16px;
  line-height: 24px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.option-card label:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.option-card input:checked + label {
  border-color: var(--primary-500);
  background: rgba(49, 152, 113, 0.10);
}

.option-check {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s ease;
}

.option-card input:checked + label .option-check {
  border-color: var(--primary-500);
}

.option-card input:checked + label .option-check::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: var(--radius-full);
  background: var(--primary-500);
}

.conditional-field {
  margin-top: var(--space-4);
  animation: step-in 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.step.shake { animation: shake 0.3s ease; }

/* ---------- Navegação ---------- */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-6);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  padding: var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color 0.2s ease;
}

.btn-back:hover { color: var(--neutral-50); }

.btn-primary {
  appearance: none;
  border: none;
  background: var(--primary-500);
  color: var(--neutral-950);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn-primary:hover {
  background: var(--neutral-50);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Tela final ---------- */
.step-final {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  animation: step-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-final.is-active { display: flex; }

.step-final .check {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(49, 152, 113, 0.12);
  border: 1px solid var(--primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  color: var(--primary-500);
}

.step-final h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 var(--space-3);
}

.step-final p {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-6);
}

.cal-embed {
  width: 100%;
  min-height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
}

.cal-embed-placeholder {
  padding: var(--space-6);
  font-size: 13px;
  color: var(--text-faint);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
}

.site-footer a {
  color: var(--text-faint);
  text-decoration: none;
}

.site-footer a:hover { color: var(--primary-500); }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro-stats { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1 1 160px; }
  .intro-main h1 { max-width: none; }
}

@media (max-width: 480px) {
  .page { padding: var(--space-5) var(--space-4) var(--space-8); }
  .site-header { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .intro-grid { grid-template-columns: 1fr; }
  .intro-main h1 { font-size: 32px; line-height: 40px; }
  .step-question { font-size: 26px; line-height: 33px; }
  .intro-stats { flex-direction: row; flex-wrap: wrap; }
  .stat-card { flex: 1 1 140px; }
}

/* Consentimento LGPD */
.aceite { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-5); font-size: 14px; line-height: 1.5; color: var(--text-muted); cursor: pointer; }
.aceite input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--primary-500); }
.aceite a { color: #6BBE9C; text-decoration: underline; text-underline-offset: 3px; }
