/* EasyKite: pesquisa pública. Sem estilos inline (CSP). */

:root {
  color-scheme: light dark;

  /* Paleta base */
  --ocean: #0b4f6c;
  --teal: #1a8fa0;
  --turq: #2fc2b5;
  --sand: #f2e2bf;
  --paper: #fbf6ec;
  --coral: #ff5a36;
  --sun: #ffc23d;

  /* Papéis */
  --bg: #fbf6ec;
  --surface: #fffdf8;
  --ink: #0a3a4f;
  --ink-soft: #476571;
  --line: #e2d4b4;
  --line-strong: #9c8a63;
  --beach: #f2e2bf;
  --sky-top: #bfe6e6;
  --sky-low: #fbefd6;

  --primary-bg: #0b4f6c;
  --primary-ink: #fbf6ec;
  --primary-hover: #083d54;
  --pick-bg: #0b4f6c;
  --pick-ink: #fbf6ec;
  --pick-tint: #e6f3f1;
  --error: #b42318;
  --error-tint: #fdece8;
  --focus: #c63c1d;

  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
[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;
}

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--primary-bg); color: var(--primary-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

a { color: inherit; }

/* ---------------------------------------------------------------- Hero */

.hero { position: relative; background: var(--sky-top); }
.hero-band { position: relative; z-index: 1; padding: 20px 0 8px; }

.brand {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.01em;
  color: var(--ink);
}
.brand-mark { width: 30px; height: 30px; }
.brand-kite { fill: var(--coral); }
.brand-line { stroke: currentColor; stroke-width: 1.2; opacity: 0.6; }

.hero-copy { max-width: 34rem; padding: clamp(28px, 7vw, 72px) 0 8px; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 1.6rem + 5.2vw, 5.25rem);
  line-height: 0.94;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.lede { margin: 20px 0 0; font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); max-width: 31rem; color: var(--ink); }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.hero-meta { margin: 0; color: var(--ink-soft); font-size: 0.975rem; }

.scene { width: 100%; height: 64vw; min-height: 230px; max-height: 340px; }

.sky-top { stop-color: var(--sky-top); }
.sky-low { stop-color: var(--sky-low); }
.glow-in { stop-color: #ffd77a; stop-opacity: 0.75; }
.glow-out { stop-color: #ffd77a; stop-opacity: 0; }
.sun { fill: #ffc23d; }
.sea-far { fill: #0b4f6c; }
.sea-mid { fill: #1a8fa0; }
.sea-near { fill: #2fc2b5; }
.foam { stroke: #f4fbf8; stroke-width: 3; opacity: 0.7; }
.glint { stroke: #e9f7f4; stroke-width: 2.5; stroke-linecap: round; opacity: 0.55; }
.sand-wet { fill: #e3cd9c; }
.sand { fill: var(--beach); }
.palm-trunk { fill: #8a6a43; }
.palm-trunk-ring { stroke: #6d5233; stroke-width: 2; }
.palm-leaf { fill: #2e7d5b; }
.palm-leaf-b { fill: #3f9a6e; }
.palm-nut { fill: #6b5a2e; }
.rider-board { fill: #ffc23d; }
.rider-body { stroke: #06303f; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.rider-head { fill: #06303f; }
.rider-wake { stroke: #f4fbf8; stroke-width: 3; stroke-linecap: round; opacity: 0.8; }
.kite { fill: var(--coral); }
.kite-strut { stroke: #c63c1d; stroke-width: 2.5; stroke-linecap: round; }
.kite-line { stroke: #0a3a4f; stroke-width: 1.4; opacity: 0.55; }
.kite-bar { stroke: #0a3a4f; stroke-width: 4; stroke-linecap: round; }

/* O equipamento gira em torno da barra, então as linhas nunca se soltam. */
.kite-rig { transform-box: view-box; transform-origin: 824px 466px; }

@media (prefers-reduced-motion: no-preference) {
  .kite-rig { animation: sway 7s ease-in-out infinite alternate; }
  .progress-fill, .progress-kite { transition: width 0.5s ease, left 0.5s ease; }
}

@keyframes sway {
  0% { transform: rotate(-2.6deg); }
  50% { transform: rotate(1.4deg); }
  100% { transform: rotate(3deg); }
}

@media (min-width: 860px) {
  .hero-band { padding-top: 28px; }
  .hero-copy { padding-bottom: 0; }
  /* No desktop, o céu da cena sobe para trás do texto e o kite voa ao lado do título. */
  .scene { height: auto; max-height: none; min-height: 0; aspect-ratio: 1440 / 680; margin-top: -19vw; }
}

@media (min-width: 1600px) {
  .scene { margin-top: -300px; }
}

/* ---------------------------------------------------------------- Botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 1.0625rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--primary-bg); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: transparent; border-color: var(--primary-bg); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: progress; opacity: 0.8; }

.btn-whatsapp { background: #177a42; color: #fff; margin-top: 8px; }
.btn-whatsapp:hover { background: #12663a; }

.link-btn {
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}

.spinner {
  width: 18px; height: 18px; flex: none;
  border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------------------------------------------------------------- Para quem é */

.why { background: var(--beach); padding: 12px 0 clamp(40px, 6vw, 72px); }
.why-grid { display: grid; gap: 28px; }
.why-item { padding-top: 14px; border-top: 2px solid #0b4f6c; max-width: 34rem; }
.why-item h3 {
  margin: 0 0 6px; font-family: var(--font-display); font-weight: 700;
  font-size: 1.625rem; line-height: 1.1;
}
.why-item p { margin: 0; color: var(--ink); }

@media (min-width: 860px) {
  .why-grid { grid-template-columns: repeat(3, 1fr); gap: 40px; }
}

/* ---------------------------------------------------------------- Pesquisa */

.survey { padding-bottom: clamp(48px, 8vw, 96px); outline: none; }
.survey-body { max-width: 44rem; margin: 0 auto; padding: 0 var(--gutter); }

.progress {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.progress-inner { max-width: 44rem; margin: 0 auto; padding: 12px var(--gutter) 14px; }
.progress-text {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0 0 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; line-height: 1.2;
}
.progress-title { color: var(--ink-soft); font-weight: 600; }
.progress-track { position: relative; height: 4px; border-radius: 4px; background: var(--line); margin-right: 22px; }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 25%; border-radius: 4px; background: var(--primary-bg); }
.progress-kite {
  position: absolute; left: 25%; top: 50%; width: 26px; height: 16px;
  transform: translate(-4px, -78%) rotate(-12deg); fill: var(--coral);
}

.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  margin-top: 24px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--pick-tint); font-size: 0.975rem;
}
.notice p { margin: 0; }

.state { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 48px 0; color: var(--ink-soft); }
.state p { margin: 0; }
.state-error { color: var(--ink); }

/* Etapas */
.step { padding-top: clamp(28px, 5vw, 48px); }
.step-head { margin-bottom: 8px; }
.step-head h2 {
  margin: 0; outline: none;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.125rem, 1.6rem + 2.2vw, 3rem); line-height: 1;
}
.step-intro { margin: 10px 0 0; color: var(--ink-soft); max-width: 36rem; }

/* Pergunta */
.q { margin: 36px 0 0; padding: 0; border: 0; min-width: 0; }
.q-label, .q legend {
  display: block; padding: 0; margin: 0; max-width: 38rem;
  font-weight: 600; font-size: 1.1875rem; line-height: 1.35;
}
.q-optional { margin-left: 6px; font-weight: 400; font-size: 0.95rem; color: var(--ink-soft); white-space: nowrap; }
.q-hint { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.975rem; }
.q-count { margin: 8px 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.q-count.is-full { color: var(--ink); font-weight: 600; }

.opts { display: grid; gap: 8px; margin-top: 14px; }
.opts-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.opt {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 11px 16px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer; line-height: 1.3;
  transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.opts-wrap .opt { padding-right: 20px; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opt:hover { border-color: var(--ink); }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.opt:has(input:checked) { background: var(--pick-bg); border-color: var(--pick-bg); color: var(--pick-ink); }
.opt:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.opt:has(input:disabled):hover { border-color: var(--line-strong); }

/* Marcador: círculo (single) ou quadrado (multi) */
.opt-mark {
  position: relative; flex: none; width: 22px; height: 22px;
  border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface);
}
.opt-multi .opt-mark, .consent .opt-mark { border-radius: 6px; }
.opt input:checked + .opt-mark { border-color: var(--pick-ink); background: transparent; }
.opt-single input:checked + .opt-mark::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--coral);
}
.opt-multi input:checked + .opt-mark::after,
.consent input:checked + .opt-mark::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px;
  border: solid var(--coral); border-width: 0 3px 3px 0; transform: rotate(45deg);
}

.q.has-error .opt { border-color: var(--error); }
.q.has-error .field { border-color: var(--error); }

/* Campos de texto */
.field {
  display: block; width: 100%; margin-top: 12px; padding: 13px 14px; min-height: 52px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 1.0625rem; line-height: 1.4;
}
.field:hover { border-color: var(--ink); }
.field:focus-visible { outline-offset: 1px; border-color: var(--ink); }
textarea.field { min-height: 120px; resize: vertical; }
.field::placeholder { color: var(--ink-soft); opacity: 0.8; }

/* Campo com prefixo só visual (ex.: "R$" em valor_mensal); o valor enviado é só o número. */
.field-prefixed { position: relative; margin-top: 12px; }
.field-prefixed .field { margin-top: 0; padding-left: 50px; font-variant-numeric: tabular-nums; }
.field-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-weight: 600; color: var(--ink-soft); pointer-events: none;
}

.other { margin-top: 10px; }
.other-label { display: block; font-size: 0.975rem; font-weight: 500; color: var(--ink-soft); }
.other .field { margin-top: 6px; }

.field-meta { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.wa-preview { margin: 6px 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.wa-preview strong { color: var(--ink); font-weight: 600; }

.q-error {
  display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0;
  color: var(--error); font-weight: 600; font-size: 0.975rem;
}
.q-error::before {
  content: "!"; flex: none; display: inline-grid; place-items: center;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--error); color: var(--surface); font-size: 0.8rem; font-weight: 700;
}

/* Etapa final */
.final { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.consent {
  display: flex; align-items: flex-start; gap: 12px; position: relative;
  padding: 16px; border-radius: var(--radius); border: 1.5px solid var(--line-strong);
  background: var(--surface); cursor: pointer; line-height: 1.45;
}
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.consent .opt-mark { margin-top: 1px; }
.consent:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.consent:has(input:checked) { border-color: var(--pick-bg); background: var(--pick-tint); }
.consent input:checked + .opt-mark { border-color: var(--ink); }
.consent.has-error { border-color: var(--error); }
.turnstile { margin-top: 20px; min-height: 65px; }

.submit-error {
  margin-top: 24px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--error-tint); color: var(--ink); border-left: 4px solid var(--error);
}
.submit-error p { margin: 0; }

.nav {
  display: flex; flex-wrap: wrap-reverse; justify-content: space-between; gap: 12px;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
}
.nav .btn-primary { margin-left: auto; min-width: 11rem; }
@media (max-width: 420px) {
  .nav .btn { flex: 1 1 auto; }
}

/* Agradecimento */
.thanks { padding: clamp(40px, 8vw, 80px) 0 16px; outline: none; }
.thanks-kite { width: 120px; height: 90px; margin-bottom: 16px; }
.thanks h2 {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.75rem, 2rem + 3vw, 4rem); line-height: 0.95;
}
.thanks p { margin: 14px 0 20px; font-size: 1.125rem; max-width: 34rem; }

/* ---------------------------------------------------------------- Rodapé */

.footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--ink-soft); font-size: 0.95rem; }
.footer p { margin: 0; max-width: 40rem; }
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; color: var(--ink); margin-bottom: 4px !important; }

/* ---------------------------------------------------------------- 404 */

.nf { min-height: 100svh; display: flex; flex-direction: column; background: var(--sky-top); }
.nf-main { flex: 1; display: flex; flex-direction: column; padding: 32px 0 0; }
.nf-main > .wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.nf h1 { max-width: 14ch; }
.nf .lede { max-width: 28rem; }
.nf-scene { width: 100%; height: 220px; margin-top: 24px; }
.nf .footer { background: var(--beach); border-top: 0; }

/* Modo escuro: valores separados de light-dark() para funcionar também em navegadores
   sem suporte (iOS Safari < 17.5, Chrome < 123). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071c26;
    --surface: #0b2a38;
    --ink: #f2e9d6;
    --ink-soft: #a9bfc3;
    --line: #1f4a5c;
    --line-strong: #4f8396;
    --beach: #142f3a;
    --sky-top: #062130;
    --sky-low: #1b4859;
    --primary-bg: #2fc2b5;
    --primary-ink: #062130;
    --primary-hover: #5ad3c8;
    --pick-bg: #2fc2b5;
    --pick-ink: #062130;
    --pick-tint: #0f3a49;
    --error: #ff9a85;
    --error-tint: #3a1d1a;
    --focus: #ff5a36;
  }
  .glow-in { stop-color: #f2e2bf; stop-opacity: 0.22; }
  .glow-out { stop-color: #f2e2bf; }
  .sun { fill: #efe2c4; }
  .sea-far { fill: #0a3a4c; }
  .sea-mid { fill: #0f5b6a; }
  .sea-near { fill: #157a78; }
  .foam { stroke: #8fd3cb; }
  .glint { stroke: #6fb8b4; }
  .sand-wet { fill: #0f2832; }
  .palm-trunk { fill: #2f3f3c; }
  .palm-trunk-ring { stroke: #23312f; }
  .palm-leaf { fill: #1d4a3d; }
  .palm-leaf-b { fill: #24594a; }
  .palm-nut { fill: #2a3a33; }
  .rider-board { fill: #ffc23d; }
  .rider-body { stroke: #e9dfc9; }
  .rider-head { fill: #e9dfc9; }
  .kite-strut { stroke: #ffb19c; }
  .kite-line { stroke: #e9dfc9; }
  .kite-bar { stroke: #e9dfc9; }
  .why-item { border-top: 2px solid #2fc2b5; }
}
