/* Direção: arquibancada, em modo claro. Laranja como sinal, preto no texto e nos títulos.
   Tudo que é cor vem destes tokens. Modo escuro só se data-theme="dark" for definido. */
:root {
  --bg: #F2F2EF;
  --surface: #FFFFFF;
  --ink: #0B0B0B;
  --muted: #5B5B57;
  --line: #D9D9D4;
  --brand: #FF7A00;     /* laranja do clube, aproximado; trocar pela paleta oficial se houver */
  --brand-ink: #0B0B0B; /* texto sobre laranja: preto, para passar em AA */
  --brand-soft: #FFEBD6;
  --ok: #1F6B45;
  --ok-soft: #DDF0E4;
  --warn: #8A4B00;
  --warn-soft: #FFE8CC;
  --bad: #A02323;
  --bad-soft: #F8DEDE;
  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0B0B; --surface: #161616; --ink: #F2F2EF; --muted: #A6A6A0; --line: #2C2C2A;
  --brand: #FF8C2A; --brand-ink: #0B0B0B; --brand-soft: #3A2412;
  --ok: #6FC494; --ok-soft: #173326; --warn: #F0B26A; --warn-soft: #3A2A14;
  --bad: #F08A8A; --bad-soft: #3B1C1C; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* Entrada: bloco preto de impacto, com o círculo central da quadra cortado na borda. */
.hero {
  position: relative; overflow: hidden; background: var(--ink); color: var(--bg);
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 56px max(16px, env(safe-area-inset-left, 0px)) 130px;
}
.hero-inner { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }
.hero h1 { font-size: clamp(64px, 13vw, 150px); line-height: .86; color: var(--bg); margin: 0; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { font: 500 18px var(--f-body); color: #CFCFCA; max-width: 44ch; margin: 20px 0 0; }
.hero .mark {
  position: absolute; right: -320px; top: -40px; width: 520px; height: 520px; z-index: 0; pointer-events: none; opacity: .4;
}
.login-card { max-width: 480px; margin: -84px auto 0; position: relative; z-index: 2; }

/* Movimento de entrada e parallax. Os valores --px, --py (mouse) e --sy (rolagem) vêm do app.js. */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 32px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero h1 .w { display: inline-block; animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 140ms + 120ms); }
.hero .mark circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s .15s cubic-bezier(.4, 0, .2, 1) forwards; }
.hero .mark {
  transform: translate3d(calc(var(--px, 0) * -26px), calc(var(--sy, 0) * 1px + var(--py, 0) * -26px), 0);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.hero-inner {
  transform: translate3d(calc(var(--px, 0) * 10px), calc(var(--sy2, 0) * 1px + var(--py, 0) * 10px), 0);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.login-card { animation: rise .9s .65s cubic-bezier(.2, .7, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .hero h1 .w, .hero .mark circle, .login-card { animation: none !important; }
  .hero .mark circle { stroke-dashoffset: 0; }
  .hero .mark, .hero-inner { transform: none !important; transition: none !important; }
}
@media (max-width: 720px) {
  .hero .mark { width: 300px; height: 300px; right: -190px; top: -60px; }
}
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  min-height: 100vh; padding-bottom: 40px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: 1; margin: 0 0 10px; }
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 19px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* Faixa de demonstração: uma linha discreta no topo */
.demo-banner {
  background: var(--brand-soft); color: var(--ink); font: 500 12px var(--f-mono); letter-spacing: .02em;
  padding: 6px 16px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  text-align: center;
}

/* Cabeçalho: faixa branca, filete laranja em cima, tudo numa linha */
.appbar {
  max-width: 1100px; margin: 0 auto; padding: 14px 0;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  border-top: 4px solid var(--brand); border-bottom: 1px solid var(--line);
}
.appbar .brand {
  font-family: var(--f-display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .02em;
  line-height: 1;
}
.appbar .who { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); }

.app { max-width: 1100px; margin: 0 auto; padding: 24px 0 40px; }

/* Botões: retos. Primário laranja com texto preto; secundário com contorno preto */
.btn {
  min-height: 44px; padding: 0 18px; border: 2px solid var(--brand); border-radius: 4px;
  background: var(--brand); color: var(--brand-ink);
  font: 700 16px var(--f-display); text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:focus-visible, .switch-btn:focus-visible, .step:focus-visible, tr.link:focus-visible {
  outline: 3px solid var(--brand); outline-offset: 2px;
}
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn.small { min-height: 36px; font-size: 14px; padding: 0 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 12px; }

/* Login: cartão com filete laranja no topo */
.login { max-width: 480px; margin: 32px auto 0; border-top: 6px solid var(--brand); }
.login-card { border-top: 6px solid var(--brand); padding: 26px; }
.choices { display: grid; gap: 10px; margin-top: 18px; }

.tag {
  font: 600 12px var(--f-mono); padding: 3px 8px; border-radius: 3px; white-space: nowrap; display: inline-block;
  background: var(--warn-soft); color: var(--warn); text-transform: uppercase; letter-spacing: .03em;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--brand-soft); color: var(--ink); }

/* Indicadores: números grandes separados por filetes */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0 20px; border-top: 2px solid var(--ink); }
.kpi { padding: 14px; border-right: 1px solid var(--line); }
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: 0; }
.kpi span { color: var(--muted); font: 600 12px var(--f-mono); text-transform: uppercase; letter-spacing: .04em; }
.kpi strong { display: block; font-family: var(--f-display); font-size: 44px; line-height: 1; font-weight: 700; }

.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
th { font: 600 12px var(--f-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--brand-soft); }
.bar { height: 6px; background: var(--line); overflow: hidden; min-width: 90px; }
.bar > div { height: 100%; background: var(--brand); }

/* Passos: abas com sublinhado laranja */
.stepper {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.step {
  min-height: 48px; border: 0; border-bottom: 4px solid transparent; background: transparent;
  color: var(--muted); font: 700 15px var(--f-display); text-transform: uppercase; letter-spacing: .03em;
  padding: 0 4px; cursor: pointer; text-align: center;
}
.step.is-current { color: var(--ink); border-bottom-color: var(--brand); }
.step.is-done { color: var(--ink); }

.field { display: grid; gap: 4px; }
.field label { font: 600 12px var(--f-mono); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
input[type="text"], input[type="date"], input[type="tel"], select {
  min-height: 44px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 16px var(--f-body); width: 100%;
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; }
.field.filled input { border-color: var(--ok); border-width: 2px; }
.from-doc { font: 500 12px var(--f-mono); color: var(--ok); }

.check {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line);
  border-radius: 4px; cursor: pointer; min-height: 48px; background: var(--surface);
}
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }

.doc { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 16px; background: var(--surface); display: grid; gap: 10px; }
.doc-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.doc-head strong { font-family: var(--f-display); font-size: 20px; text-transform: uppercase; font-weight: 700; }
.dropzone { border: 1px dashed var(--muted); border-radius: 4px; padding: 14px; display: grid; gap: 8px; justify-items: start; }
.dropzone input[type="file"] { font: 14px var(--f-body); color: var(--ink); max-width: 100%; }
.thumb { width: 120px; height: 84px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.warn-text { color: var(--bad); font-size: 14px; margin: 0; font-weight: 600; }

.progress { height: 6px; background: var(--line); overflow: hidden; width: 100%; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .3s; }
@media (prefers-reduced-motion: reduce) { .progress > div, .toast { transition: none; } }

.review { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.review li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }

.nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.empty { text-align: center; padding: 36px 10px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 4px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
  border-left: 4px solid var(--brand);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Tutorial: cartão fixo embaixo, com o recurso em destaque pulsando */
.tour-card {
  position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom, 0px)); margin: 0 auto;
  width: min(460px, calc(100% - 32px)); z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 6px;
  padding: 16px 18px; box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}
.tour-card h3 { margin: 6px 0 8px; }
.tour-card .row { margin-top: 12px; }
.tour-card.is-in { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.tour-alvo { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 4px; animation: pulso 1.6s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { outline-color: var(--brand); } 50% { outline-color: transparent; } }
.tour-prog { height: 4px; background: var(--line); margin-top: 12px; overflow: hidden; }
.tour-prog > div { height: 100%; background: var(--brand); transform-origin: left center; transform: scaleX(0); }
.tour-prog > div.rodando { animation: grow linear forwards; }
.tour-prog > div.pausada { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .tour-card.is-in, .tour-alvo { animation: none; }
  .tour-prog > div.rodando { animation: none; transform: scaleX(1); }
}

/* Telas: entrada escalonada, barras que crescem, linhas que sobem. Só toca ao trocar de tela ou etapa. */
.app > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--n, 0) * 70ms); }
.app.no-anim * { animation: none !important; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar > div { transform-origin: left center; animation: grow .9s .25s cubic-bezier(.2, .7, .2, 1) both; }
tbody tr { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
tbody tr:nth-child(2) { animation-delay: .08s; }
tbody tr:nth-child(3) { animation-delay: .14s; }
tbody tr:nth-child(4) { animation-delay: .2s; }
tbody tr:nth-child(5) { animation-delay: .26s; }
tbody tr:nth-child(6) { animation-delay: .32s; }
tbody tr:nth-child(n+7) { animation-delay: .38s; }
.btn { transition: transform .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .app > *, tbody tr, .bar > div { animation: none !important; }
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* Celular */
@media (max-width: 720px) {
  h1 { font-size: 34px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(3) { padding-left: 0; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
