/* ==========================================================================
   Plataforma IIH — Instituto Economia ao Natural
   Folha de estilo única. Ordem: tokens → reset → utilitários → componentes
   → seções → modal/formulário → responsivo.
   Cores e tipografia conforme Manual de Marca 2026 (docs/Manual de Marca.pdf).
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Marca */
  --blue-900: #123047;   /* azul petróleo — textos e footer */
  --blue-700: #1B769C;   /* azul institucional — cor primária */
  --blue-500: #308EB7;
  --cyan-400: #60C7D0;
  --orange:   #F99732;   /* CTA principal */
  --orange-ink:#B8611A;
  --yellow:   #FFCD26;

  /* Neutros / fundos */
  --sand-50:  #FBF8F2;   /* fundo padrão da página */
  --sand-100: #F2EDE3;   /* faixas alternadas */
  --sand-200: #E4DFD3;   /* bordas de campo */
  --sand-300: #B8B0A0;
  --white:    #FFFFFF;

  /* Texto */
  --ink:      #123047;
  --ink-soft: #4A5A66;
  --ink-mute: #6B7A85;

  /* Tintas claras (chips / ícones) */
  --tint-blue:   #E3F0F5;
  --tint-orange: #FDEBD6;
  --tint-cyan:   #E1F4F6;
  --tint-yellow: #FFF3CC;

  /* Tipografia */
  --font-display: "Quicksand", "Trebuchet MS", sans-serif;   /* substitui Lelawadee Bold */
  --font-text:    "Nunito Sans", "Segoe UI", sans-serif;

  /* Layout */
  --container: 1312px;
  --gutter: 64px;
  --radius-card: 24px;
  --radius-field: 10px;
  --radius-pill: 30px;
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sand-50);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; }
h1 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.1; }
h2 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.2; }
h3 { font-size: 20px; }
p  { margin: 0; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--blue-500); }

button { font-family: inherit; cursor: pointer; border: 0; background: none; }

:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--blue-700); color: #fff; padding: 10px 18px; border-radius: 8px;
  font: 700 14px var(--font-text);
}
.skip-link:focus { left: 16px; color: #fff; }

/* ---------- 3. UTILITÁRIOS ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding: 80px 0; }
.section-sand { background: var(--sand-100); }
.section-lead { font-size: 17px; color: var(--ink-soft); max-width: 56ch; margin-top: 8px; }
.mini-title { font: 700 13px var(--font-text); }
.fine { font-size: 13px; color: var(--ink-mute); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 40px; }

/* ---------- 4. BOTÕES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 15px var(--font-text);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  transition: background-color .18s ease, color .18s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { font-size: 16px; padding: 16px 30px; }
.btn-block { display: flex; width: 100%; }
.btn-grow { flex: 2; }

.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #E8862A; }
.btn-orange:disabled { background: var(--sand-200); color: #9A9282; cursor: not-allowed; }

.btn-blue { background: var(--blue-700); color: #fff; }
.btn-blue:hover { background: var(--blue-500); }

.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }

.btn-outline { background: #fff; color: var(--ink-soft); border: 1.5px solid var(--sand-200); flex: 1; }
.btn-outline:hover { border-color: var(--sand-300); }

.btn-row { display: flex; flex-wrap: wrap; gap: 16px; }
.btn-pair { display: flex; gap: 10px; }
.btn-pair .btn { border-radius: 12px; padding: 14px; }

/* ---------- 5. HEADER ---------- */
.site-header { background: var(--sand-50); position: sticky; top: 0; z-index: 60; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 24px; }
.brand img { height: 52px; width: auto; object-fit: contain; }

.site-nav { display: flex; align-items: center; gap: 36px; font: 600 15px var(--font-text); }
.site-nav a { color: var(--ink); }
.site-nav a:hover { color: var(--blue-700); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 10px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- 6. HERO ---------- */
.hero { position: relative; overflow: hidden; padding: 80px 0 100px; }
.hero-inner { position: relative; }
.hero-inner > * + * { margin-top: 24px; }
.hero-inner h1, .hero-inner .lead { max-width: 620px; }
.lead { font-size: 19px; color: var(--ink-soft); }

.hero-orb {
  position: absolute; right: -120px; top: -140px;
  width: 520px; height: 520px; border-radius: 50%;
  background: conic-gradient(var(--cyan-400) 0deg 90deg, var(--orange) 90deg 180deg,
                             var(--yellow) 180deg 270deg, var(--blue-500) 270deg 360deg);
  opacity: .18; pointer-events: none;
}

.eyebrow {
  display: inline-block; background: #FFE9C7; color: var(--orange-ink);
  font: 700 13px var(--font-text); letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px;
}

/* ---------- 7. CARDS DE PAPÉIS ---------- */
.card {
  background: var(--white); border-radius: var(--radius-card); padding: 32px;
  border-top: 6px solid var(--blue-700);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 15px; color: var(--ink-soft); }
.card-accent-blue   { border-top-color: var(--blue-700); }
.card-accent-orange { border-top-color: var(--orange); }
.card-accent-cyan   { border-top-color: var(--cyan-400); }

.card-clickable { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.card-clickable:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(18, 48, 71, .1); }
.card-cta { display: inline-block; margin-top: 12px; font: 800 13px var(--font-text); color: var(--orange); }

.card-icon { width: 52px; height: 52px; border-radius: 50%; margin-bottom: 20px; }
.icon-blue   { background: var(--tint-blue); }
.icon-orange { background: var(--tint-orange); }
.icon-cyan   { background: var(--tint-cyan); }

/* ---------- 8. STEPS (COMO FUNCIONA) ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; margin-top: 44px; }
.steps li { text-align: center; }
.steps p { font: 600 14px var(--font-text); }
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  font: 700 22px var(--font-display); color: #fff;
}
.step-1 { background: var(--blue-700); }
.step-2 { background: var(--blue-500); }
.step-3 { background: var(--cyan-400); }
.step-4 { background: var(--orange); }
.step-5 { background: var(--yellow); color: var(--ink); }

/* ---------- 9. ÍNDICE IIH ---------- */
.split { display: flex; gap: 56px; align-items: flex-start; }
.split-aside { flex: 0 0 380px; }
.split-main { flex: 1; }

.note {
  margin-top: 20px; background: #fff; border-left: 4px solid var(--yellow);
  border-radius: 16px; padding: 16px 20px;
  font: 600 13px/1.5 var(--font-text); color: #7A6A3F;
}

.dims { display: flex; flex-direction: column; gap: 14px; }
.dim { display: flex; align-items: center; gap: 16px; }
.dim-label { flex: 0 1 240px; min-width: 0; font: 700 14px var(--font-text); }
.dim-pct { font: 700 13px var(--font-text); color: var(--ink-soft); }
.bar { flex: 1; height: 14px; background: #EDE7DA; border-radius: 8px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 8px; }
.fill-blue     { background: var(--blue-700); }
.fill-blue-mid { background: var(--blue-500); }
.fill-cyan     { background: var(--cyan-400); }
.fill-orange   { background: var(--orange); }

/* ---------- 10. PAINEL ---------- */
.panel-row { display: flex; gap: 28px; margin-top: 32px; }
.stat-card {
  flex: 1; background: var(--blue-900); color: #fff;
  border-radius: 20px; padding: 28px;
}
.stat-card strong { display: block; font: 700 40px var(--font-display); }
.stat-card span { font: 600 13px var(--font-text); opacity: .75; }

.segments-card {
  flex: 2; background: #fff; border-radius: 20px; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font: 700 12px var(--font-text); padding: 6px 14px; border-radius: 16px; }
.chip-blue   { background: var(--tint-blue);   color: var(--blue-700); }
.chip-orange { background: var(--tint-orange); color: var(--orange-ink); }
.chip-cyan   { background: var(--tint-cyan);   color: #1F7E88; }
.chip-yellow { background: var(--tint-yellow); color: #8A6D00; }

/* ---------- 11. FASES ---------- */
.phase { border-radius: 20px; padding: 28px; }
.phase p + p { margin-top: 10px; }
.phase p:last-child { font-size: 15px; line-height: 1.7; }
.phase-tag { font: 700 13px var(--font-text); text-transform: uppercase; letter-spacing: .03em; }
.phase-current { border: 2px solid var(--blue-700); }
.phase-current .phase-tag { color: var(--blue-700); }
.phase-next { border: 2px dashed var(--sand-300); }
.phase-next .phase-tag { color: #8A8270; }
.phase-next p:last-child { color: var(--ink-soft); }

/* ---------- 12. FOOTER ---------- */
.site-footer { background: var(--blue-900); color: #fff; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; align-items: center; padding-block: 36px;
  font: 600 13px var(--font-text);
}
.site-footer span { opacity: .8; }
.footer-credit { opacity: .6 !important; }

/* ==========================================================================
   13. MODAL + FORMULÁRIO
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 48, 71, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay[hidden] { display: none; }

.modal {
  width: 100%; max-width: 420px; max-height: 88vh;
  background: var(--sand-50); border-radius: 32px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
  animation: slideUp .25s ease;
}

.modal-head { position: relative; background: var(--blue-700); color: #fff; padding: 20px 24px 22px; }
.modal-kicker { font: 700 12px var(--font-text); letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.modal-head h2 { font-size: 21px; margin-top: 6px; }
.modal-close {
  position: absolute; top: 16px; right: 20px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .2); color: #fff;
  font: 700 18px/1 var(--font-text);
}
.modal-close:hover { background: rgba(255, 255, 255, .34); }

.modal-body { padding: 24px 24px 28px; overflow-y: auto; }

.progress { display: flex; gap: 6px; margin-bottom: 22px; }
.progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--sand-200); transition: background-color .25s ease; }
.progress i.is-on { background: var(--blue-700); }

.step[hidden] { display: none; }
.step > h3 { margin-bottom: 4px; }
.step > .fine { margin-bottom: 18px; }

/* Campos */
label { display: block; font: 700 12px var(--font-text); color: var(--ink-soft); margin-bottom: 6px; }
input[type="text"], input[type="number"], textarea {
  width: 100%; background: #fff; color: var(--ink);
  border: 1.5px solid var(--sand-200); border-radius: var(--radius-field);
  padding: 13px 14px; font: 400 15px var(--font-text);
  margin-bottom: 16px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.6; font-size: 14px; margin-bottom: 4px; }
input:focus, textarea:focus { outline: none; border-color: var(--blue-700); }
input.is-invalid { border-color: #C0392B; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Segmented control (Sexo) */
.seg-field { border: 0; padding: 0; margin: 0 0 22px; }
.seg-field legend { font: 700 12px var(--font-text); color: var(--ink-soft); margin-bottom: 8px; padding: 0; }
.seg-control { display: flex; gap: 10px; }
.seg-control button {
  flex: 1; text-align: center; padding: 11px;
  background: #fff; border: 1.5px solid var(--sand-200); border-radius: var(--radius-field);
  font: 700 13px var(--font-text); color: var(--ink-soft);
  transition: background-color .16s ease, color .16s ease;
}
.seg-control button[aria-pressed="true"] { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }

/* Consentimento LGPD */
.consent {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--sand-100); border-radius: 12px; padding: 14px;
  margin-bottom: 22px; cursor: pointer;
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-box {
  flex: 0 0 20px; height: 20px; border-radius: 5px;
  background: #fff; border: 2px solid var(--sand-300);
  transition: background-color .16s ease, border-color .16s ease;
}
.consent input:checked + .consent-box { background: var(--blue-700); border-color: var(--blue-700); }
.consent input:focus-visible + .consent-box { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.consent-text { font: 600 12px/1.5 var(--font-text); color: var(--ink-soft); }

.form-error { font: 700 12px var(--font-text); color: #C0392B; margin-bottom: 14px; }
.form-error[hidden] { display: none; }

/* Questionário */
.q-kicker { font: 700 12px var(--font-text); color: var(--orange); text-transform: uppercase; margin-bottom: 6px; }
.q-text { font: 600 17px/1.4 var(--font-display); color: var(--ink); margin-bottom: 20px; }

.likert { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.likert-option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid var(--sand-200); border-radius: var(--radius-field);
  padding: 13px 16px; font: 600 14px var(--font-text); color: var(--ink-soft);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.likert-option:hover { border-color: var(--blue-500); }
.likert-option .dot {
  flex: 0 0 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--sand-300);
  transition: border-width .16s ease, border-color .16s ease;
}
.likert-option[aria-checked="true"] {
  background: var(--tint-blue); border-color: var(--blue-700);
  color: var(--blue-700); font-weight: 700;
}
.likert-option[aria-checked="true"] .dot { border: 5px solid var(--blue-700); }

.char-count { text-align: right; margin-bottom: 18px; }

/* Confirmação */
.step-done { text-align: center; padding: 12px 0 4px; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--yellow); margin: 8px auto 20px; }
.step-done h3 { margin-bottom: 10px; }
.step-done .fine { margin-bottom: 26px; }

/* ---------- 14. ANIMAÇÕES ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

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

/* ---------- 15. RESPONSIVO ---------- */
@media (max-width: 1080px) {
  :root { --gutter: 40px; }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 32px; }
  .split { flex-direction: column; align-items: stretch; gap: 32px; }
  .split-aside { flex: none; width: 100%; }
  .split-main { width: 100%; }
}

@media (max-width: 860px) {
  :root { --gutter: 24px; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 64px; }
  .hero-orb { width: 320px; height: 320px; right: -100px; top: -90px; }

  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--sand-50); padding: 16px 24px 24px;
    box-shadow: 0 16px 32px rgba(18, 48, 71, .12);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--sand-200); }
  .site-nav .btn { margin-top: 12px; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .panel-row { flex-direction: column; }
  .dim { flex-wrap: wrap; }
  .dim-label { flex: 1 0 100%; }
}

@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; text-align: left; }
  .steps li { display: flex; align-items: center; gap: 16px; text-align: left; }
  .step-num { margin: 0; flex: 0 0 48px; height: 48px; font-size: 19px; }
  .btn-row .btn { width: 100%; }
  .modal { border-radius: 24px; max-height: 92vh; }
  .field-row { grid-template-columns: 1fr; }
}
