/* Treinora — identidade "Campo": claro, verde profundo com toque de lima. */
:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F1F2EC;
  --line: #E3E5DD;
  --line-strong: #C9CEC4;
  --text: #17201B;
  --muted: #5B655F;
  --accent: #1E4D3A;          /* verde profundo: marca, botões principais, links */
  --accent-hover: #173D2E;
  --accent-ink: #F4F7F0;      /* texto sobre o verde */
  --accent-soft: #E6EEE3;     /* fundo de selecionados */
  --lime: #C8F169;            /* toque de lima: só sobre o verde profundo */
  --lime-ink: #1E4D3A;
  --warn: #8A5A00;
  --warn-bg: #FFF4DC;
  --warn-line: #F0D9A4;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --info: #2C6E8F;
  --radius: 16px;
  --radius-sm: 12px;
  --nav-h: calc(3.25rem + 16px);
  --focus: #1E4D3A;
  --focus-halo: #C8F169;
  --font-scale: 1;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: calc(100% * var(--font-scale)); }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; }
p { margin: 0; }
.ico { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; }

/* ---------- Logotipo "Treinora" ---------- */
.logo-mark { display: block; flex-shrink: 0; border-radius: 26%; }
.logo-word { font-weight: 800; letter-spacing: -0.035em; color: var(--text); display: inline-flex; align-items: baseline; white-space: nowrap; }
.logo-ora { color: var(--accent); }

/* ---------- Topbar / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.brand { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.points-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.875rem; font-weight: 700; color: var(--accent); }

main { padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 24px); outline: none; }
body.no-nav main { padding-bottom: calc(24px + var(--safe-b)); }
body.no-nav .bottomnav { display: none; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  max-width: 560px; margin: 0 auto;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottomnav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; text-align: center; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; font-size: 0.7188rem; font-weight: 600; color: var(--muted); }
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a.active svg { stroke-width: 2.2; }

/* ---------- Building blocks ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap > :not([aria-hidden]) { min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.7813rem; }
.center { text-align: center; }
.mt { margin-top: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { font-size: 1.25rem; }
.card h3 { font-size: 1rem; }
.eyebrow { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* Card de destaque: verde profundo com lima (treino de hoje, evolução) */
.card.accent {
  --muted: #B9C9BF; --line: #2F6650; --surface-2: #2A5A46; --focus: var(--lime); --focus-halo: var(--accent);
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.card.accent .eyebrow { color: var(--lime); }
.card.accent .chip { background: rgba(255,255,255,.1); border-color: transparent; color: var(--accent-ink); }
.card.accent .chip.accent { background: var(--lime); color: var(--lime-ink); }
.card.accent .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: var(--accent-ink); }
.card.accent .btn.primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.card.accent .btn.primary:hover { background: #D6F68A; }
.card.accent .btn.primary .ico { color: var(--lime-ink); }
.card.accent .link, .card.accent a.link { color: var(--lime); }
.card.accent .progress { background: #2F6650; }
.card.accent .progress > i { background: var(--lime); }
.card.accent .ico { color: var(--lime); }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card.warn .ico { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 6px 16px; border-radius: 12px; border: 1px solid var(--line-strong); text-align: center; line-height: 1.2;
  background: var(--surface); font-weight: 700; font-size: 1rem; transition: transform .1s, background .15s, opacity .2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary .ico { color: var(--lime); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 0.875rem; border-radius: 10px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn[hidden] { display: none; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.8125rem; font-weight: 500; color: var(--muted); border: 1px solid transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.card .stat { background: var(--surface-2); border-color: transparent; }
.stat b { display: flex; align-items: center; gap: 4px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.75rem; color: var(--muted); }
.flame { color: #D9622B; }

/* ---------- Home ---------- */
.hero { padding: 26px 20px; text-align: center; }
.hero-mark { display: flex; justify-content: center; margin-bottom: 14px; }
.hero h1 { font-size: 1.75rem; margin-bottom: 8px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; list-style: none; padding: 0; margin: 0; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.week .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 0.875rem; background: var(--surface-2); border: 1.5px solid transparent; }
.week .scheduled .dot { border-color: var(--line-strong); border-style: dashed; background: transparent; }
.week .checked .dot { background: var(--accent); color: var(--lime); border: none; font-weight: 800; }
.week .missed .dot { background: var(--danger-bg); color: var(--danger); }
.week .today { color: var(--text); font-weight: 800; }
.week .today .dot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

.muscles { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Quiz ---------- */
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.quiz-head .progress { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); font-size: 1.125rem; }
.icon-btn:hover { background: var(--surface-2); }
.quiz-q { font-size: 1.625rem; margin-bottom: 6px; }
.quiz-sub { color: var(--muted); margin-bottom: 20px; }
.options { display: grid; gap: 10px; }
.options.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); }
.options.cols-4 { grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  min-height: 56px; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--line-strong); }
.opt .ic { width: 30px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent); }
.opt .tx { display: flex; flex-direction: column; }
.opt .tx b { font-weight: 700; }
.opt .tx small { color: var(--muted); font-size: 0.8125rem; }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
/* Treino de casa × academia (os dois ativos) */
.plan-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 8px; }
.plan-switch .opt { gap: 8px; }
.plan-switch .done-mark { margin-left: auto; color: var(--accent); font-weight: 800; }
/* Múltipla escolha: caixinha de seleção e aviso de que dá para marcar várias */
.multi-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -8px 0 14px; color: var(--accent); }
.opt.multi .ck { width: 1.375rem; height: 1.375rem; flex-shrink: 0; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--surface); display: grid; place-items: center; }
.opt.multi.selected .ck { background: var(--accent); border-color: var(--accent); }
.opt.multi.selected .ck::after { content: ''; width: 0.35rem; height: 0.7rem; margin-top: -0.15rem; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.a11y-contrast .opt.multi .ck { border-color: currentColor; }
.opt.compact { justify-content: center; text-align: center; padding: 10px 6px; min-height: 50px; font-weight: 700; }
.opt.tall { flex-direction: column; justify-content: center; text-align: center; min-height: 120px; }
.opt.tall .ic { width: auto; }

.number-picker { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px 0; }
.number-picker .value { font-size: min(4rem, 15vw); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.number-picker .value small { font-size: 1.375rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.number-picker .ctrls { display: flex; align-items: center; gap: 18px; width: 100%; }
.number-picker .step { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: 1.625rem; flex-shrink: 0; }
input[type=range] { flex: 1; accent-color: var(--accent); height: 28px; }
.bmi { font-size: 0.875rem; color: var(--muted); }

.field { width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; }
.field::placeholder { color: #8A938D; }
.field:focus { border-color: var(--accent); }
textarea.field { min-height: 80px; resize: vertical; }

.quiz-foot { position: sticky; bottom: 0; padding: 16px 0 calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 22px; }

.review { display: grid; gap: 1px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.review button { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; text-align: left; padding: 13px 16px; background: var(--surface); border: 0; }
.review button span:first-child { color: var(--muted); font-size: 0.875rem; flex: 1 1 9rem; }
.review button span:last-child { font-weight: 700; text-align: right; font-size: 0.875rem; }

/* ---------- Generating ---------- */
.gen { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 20px; }
.gen-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.pulse { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(30,77,58,.35); } 50% { transform: scale(1.05); box-shadow: 0 0 0 22px rgba(30,77,58,0); } }
.gen-tip { min-height: 48px; color: var(--muted); max-width: 340px; }

/* ---------- Plan ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.tab b { display: block; font-size: 0.875rem; font-weight: 800; }
.tab small { color: var(--muted); font-size: 0.75rem; }
.tab.active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.tab.active small { color: #B9C9BF; }

.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ex summary { list-style: none; padding: 16px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.ex summary::-webkit-details-marker { display: none; }
.ex .num { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 0.875rem; flex-shrink: 0; }
.ex .h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.ex .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ex .body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 0.9063rem; }
.ex .body h5 { margin: 0 0 3px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ex[open] .chev { transform: rotate(180deg); }
.chev { margin-left: auto; color: var(--muted); transition: transform .2s; flex-shrink: 0; }

.info-block h3 { margin-bottom: 8px; }
.info-block ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Progress ---------- */
.tier { display: flex; align-items: center; gap: 16px; }
.tier .medal { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.celebrate-ic { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: var(--lime); display: grid; place-items: center; }
.heat, .heat-labels { width: 100%; max-width: 230px; margin: 0 auto; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); }
.heat i.s { outline: 1px dashed var(--line-strong); outline-offset: -1px; background: transparent; }
.heat i.c { background: var(--accent); }
.heat i.f { opacity: .3; }
.heat-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; font-size: 0.6875rem; color: var(--muted); text-align: center; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.badge { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; }
.card .badge { background: var(--surface-2); border-color: transparent; }
.badge .ic { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: var(--lime); display: grid; place-items: center; }
.badge b { display: block; font-size: 0.8125rem; font-weight: 800; margin-top: 8px; }
.badge small { color: var(--muted); font-size: 0.7188rem; line-height: 1.3; display: block; margin-top: 2px; }
.badge.locked .ic { background: var(--line); color: var(--muted); }
.badge.locked b { color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bars .bar { display: grid; grid-template-columns: minmax(6rem, auto) 1fr 2rem; gap: 10px; align-items: center; font-size: 0.875rem; }
.bars .bar > span:first-child { display: inline-flex; align-items: center; gap: 8px; }

/* Intensidade do esforço (1 a 3 barras) */
.effort-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.effort-bars i { width: 5px; border-radius: 2px; background: var(--line-strong); }
.effort-bars i.on { background: var(--accent); }
.opt.selected .effort-bars i.on { background: var(--accent); }

/* ---------- Legal ---------- */
.legal p + p { margin-top: 12px; }
.legal strong { color: var(--text); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9375rem; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* ---------- Modal / toast / confetti ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(23,32,27,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.modal { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + var(--safe-b)); animation: up .25s ease-out; }
.modal h2 { font-size: 1.375rem; margin-bottom: 6px; }
.modal .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: -8px auto 16px; }
@media (min-width: 600px) { .modal-back { align-items: center; } .modal { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translateX(-50%) translateY(20px); z-index: 60; background: var(--accent); color: var(--accent-ink); padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 0.875rem; opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

.spinner { width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Anatomia ---------- */
.anatomy svg { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.anatomy .b { fill: #E4E7DF; }
.anatomy .m { fill: #D3D8CD; }
.anatomy .s { fill: #9BC27B; }
.anatomy .p { fill: var(--accent); }
.anatomy g > * { stroke: var(--surface); stroke-width: .6; }
.anatomy text { fill: var(--muted); font-size: 7px; font-family: inherit; stroke: none; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7813rem; color: var(--muted); }
.lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.lg.p::before { background: var(--accent); }
.lg.s::before { background: #9BC27B; }
.lg.p { color: var(--text); font-weight: 700; }

/* ---------- Seções recolhíveis (links) ---------- */
.folds { display: flex; flex-direction: column; }
.card.folds { padding: 4px 18px; }
.fold + .fold { border-top: 1px solid var(--line); }
.fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; color: var(--accent); font-weight: 700; font-size: 0.875rem; letter-spacing: .02em; }
.fold summary::-webkit-details-marker { display: none; }
.fold-chev { color: var(--muted); transition: transform .2s; }
.fold[open] .fold-chev { transform: rotate(180deg); }
.fold-body { padding: 2px 0 12px; font-size: 0.9063rem; }
.fold-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Conta (entrar / criar conta / confirmar) ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 12px 0 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; }
.auth-logo { display: grid; place-items: center; }
.auth-brand { font-size: 1.375rem; margin-top: 4px; }
.auth-head h1 { font-size: 1.625rem; margin-top: 8px; }
.auth-head p { max-width: 340px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; }
.auth-field > span, .auth-field > label { color: var(--muted); font-weight: 600; }
.pw { position: relative; }
.pw .field { padding-right: 48px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; border-radius: 10px; font-size: 1.125rem; color: var(--muted); display: grid; place-items: center; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--accent); background: var(--surface-2); }
.auth-error { color: var(--danger); font-size: 0.875rem; font-weight: 600; min-height: 0; }
.auth-error:empty { display: none; }
.auth-link { color: var(--accent); font-weight: 700; font-size: 0.875rem; }
.auth-alt { text-align: center; font-size: 0.875rem; }
.auth-note { background: var(--accent-soft); color: var(--accent); padding: 10px 12px; border-radius: 12px; font-size: 0.875rem; font-weight: 600; }
.code-input { font-size: 1.75rem; letter-spacing: 10px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.points-chip[hidden] { display: none; }

/* ---------- Títulos com aparência de outro nível (hierarquia semântica sem mudar o visual) ---------- */
.h2 { font-size: 1.375rem; }
.h3, .card .h3 { font-size: 1rem; font-weight: 800; }
.h4 { font-size: 1rem; }
.card h2:not(.h3) { font-size: 1.25rem; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.opt-label { font-size: 0.9063rem; }
.ex-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hist-row { gap: 6px 10px; }
.legend-sq { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend-sq.c { background: var(--accent); }
.legend-sq.s { outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.btn.danger-solid { background: var(--danger); color: #FFFFFF; border-color: transparent; }
.icon-btn.sm { width: 36px; height: 36px; font-size: 0.95rem; border-radius: 10px; }
.icon-btn.danger { color: var(--danger); }
.field.sm { padding: 8px 10px; font-size: 0.875rem; border-radius: 10px; width: auto; }

/* ---------- Acessibilidade: foco, pular para o conteúdo, leitores de tela ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }
.field:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -200px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.skip-link:focus { top: calc(12px + var(--safe-t)); }

/* Cabeçalho: pontos + perfil */
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.profile-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.profile-btn[hidden] { display: none; }

/* Botão de acessibilidade sempre disponível (no cabeçalho fixo, sem sobrepor o conteúdo) */
.a11y-btn { color: var(--accent); border-color: var(--line-strong); }
.a11y-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.a11y-btn svg circle { fill: currentColor; stroke: none; }
body.modal-open { overflow: hidden; }

/* Painel de acessibilidade */
.a11y-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.a11y-label { font-weight: 700; }
.a11y-scale { display: flex; flex-direction: column; gap: 8px; }
.a11y-scale-ctrls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a11y-scale-ctrls input[type=range] { flex: 1 1 8rem; }
.a11y-panel .step { min-width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 800; font-size: 1rem; }
.a11y-panel .step:disabled { opacity: .4; }
.a11y-scale-value { min-width: 3.5rem; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.a11y-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.a11y-toggle-text { display: flex; flex-direction: column; min-width: 0; }
.a11y-toggle-text small { color: var(--muted); font-size: 0.8125rem; }
.a11y-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex-shrink: 0; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--line-strong); position: relative; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s; }
.a11y-toggle input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.a11y-toggle input:checked + .switch::after { transform: translateX(20px); background: var(--lime); }
.a11y-toggle input:focus-visible + .switch { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }

/* Perfil */
.avatar { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: var(--lime); display: grid; place-items: center; font-weight: 800; font-size: 1.125rem; }
fieldset.card { margin: 0; min-width: 0; }
fieldset.card > legend, .ex-edit > legend { float: left; width: 100%; padding: 0; margin-bottom: 8px; }
fieldset.card > legend + *, .ex-edit > legend + * { clear: both; }
.radio-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.radio-row:last-of-type { border-bottom: 0; }
.radio-row input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; margin: 0; }
.about p + p { margin-top: 4px; }
.about { padding: 8px 0 4px; }

/* Idioma nas telas de entrar/cadastrar */
.auth-lang { display: flex; justify-content: flex-end; }

/* Treino manual */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 10px; }
.span-2 { grid-column: 1 / -1; }
.ex-edit { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ex-edit > legend { font-weight: 700; font-size: 0.875rem; color: var(--muted); }
.options.cols-days { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.5rem), 1fr)); }
/* Triagem de saúde (PAR-Q+) */
.parq-q { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.options.yes-no { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options.pain-scale { grid-template-columns: repeat(auto-fill, minmax(2.9rem, 1fr)); gap: 6px; }
.options.pain-scale .opt.compact { padding: 8px 2px; min-height: 48px; }
.check.card { padding: 16px; }
.chip-x { margin-left: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: inherit; font-size: 0.75rem; display: inline-grid; place-items: center; }
.chip-x:hover { background: var(--line); }
abbr[title] { text-decoration: none; color: var(--danger); }

/* Marcação de exercício concluído (página do treino) */
.ex-item { position: relative; }
.ex-item .ex summary { padding-right: 68px; }
.ex-check { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; }
.ex-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ex-check .box { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; font-weight: 800; font-size: 1rem; line-height: 1; transition: background .15s, border-color .15s; }
.ex-check:hover .box { border-color: var(--accent); }
.ex-check input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--lime); }
.ex-check input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 7px var(--focus-halo); }
.ex-item.done .ex { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.ex-item.done .h4 { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.ex-item.done .num { background: var(--accent); color: var(--lime); }

/* ---------- Preferências de acessibilidade (classes aplicadas no <html>) ---------- */
/* Alto contraste */
.a11y-contrast {
  --bg: #000; --surface: #000; --surface-2: #161616; --line: #ffffff; --line-strong: #ffffff;
  --text: #ffffff; --muted: #e6e6e6; --accent: #d4ff3a; --accent-hover: #e2ff7a; --accent-ink: #000000;
  --accent-soft: rgba(212, 255, 58, .2); --lime: #000000; --lime-ink: #d4ff3a;
  --danger: #ff9b9b; --danger-bg: #2a0000; --warn: #ffd166; --warn-bg: #000; --warn-line: #ffd166;
  --focus: #00e5ff; --focus-halo: #000; color-scheme: dark;
}
.a11y-contrast .card, .a11y-contrast .opt, .a11y-contrast .btn, .a11y-contrast .field, .a11y-contrast .chip,
.a11y-contrast .stat, .a11y-contrast .badge, .a11y-contrast .tab, .a11y-contrast .ex, .a11y-contrast .icon-btn { border-width: 2px; }
.a11y-contrast .card.accent { --muted: #e6e6e6; --line: #ffffff; --surface-2: #161616; --focus: #00e5ff; --focus-halo: #000; background: #000; border-color: #d4ff3a; color: #fff; }
.a11y-contrast .card.accent .btn.primary, .a11y-contrast .card.accent .chip.accent { background: #d4ff3a; color: #000; }
.a11y-contrast .card.accent .eyebrow, .a11y-contrast .card.accent .ico, .a11y-contrast .card.accent .link { color: #d4ff3a; }
.a11y-contrast .card.accent .progress > i { background: #d4ff3a; }
.a11y-contrast .card.warn { background: #000; }
.a11y-contrast .tab.active small { color: #000; }
.a11y-contrast .logo-ora { color: inherit; }
.a11y-contrast .badge.locked .ic { background: #3a3a3a; color: #e6e6e6; }
.a11y-contrast .anatomy .b { fill: #3a3a3a; }
.a11y-contrast .anatomy .m { fill: #6a6a6a; }
.a11y-contrast .anatomy .s { fill: #7fa01e; }
.a11y-contrast .anatomy g > * { stroke: #000; }
/* Reduzir movimento */
.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* Sublinhar elementos clicáveis */
.a11y-underline a, .a11y-underline button, .a11y-underline summary, .a11y-underline [role=tab], .a11y-underline .radio-row, .a11y-underline .a11y-toggle {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
/* Fonte de leitura facilitada */
.a11y-readable body, .a11y-readable button, .a11y-readable input, .a11y-readable select, .a11y-readable textarea {
  font-family: 'Atkinson Hyperlegible', Verdana, Tahoma, sans-serif; letter-spacing: .02em; word-spacing: .08em;
}
.a11y-readable body { line-height: 1.65; }
.a11y-readable h1, .a11y-readable h2, .a11y-readable h3, .a11y-readable h4 { letter-spacing: 0; line-height: 1.3; }
/* Cursor ampliado */
.a11y-cursor, .a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 10.5-6.6 1.3L9 21z' fill='%23000' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 7 3, auto !important;
}
.a11y-cursor a, .a11y-cursor button, .a11y-cursor summary, .a11y-cursor label, .a11y-cursor select, .a11y-cursor [role=tab],
.a11y-cursor a *, .a11y-cursor button *, .a11y-cursor summary *, .a11y-cursor label * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 10.5-6.6 1.3L9 21z' fill='%23C8F169' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 7 3, pointer !important;
}
.a11y-motion .ex-check .box { transition: none; }

/* ---------- Comunidade: desafio, amigos e personal ---------- */
.gen-ic.sm { width: 44px; height: 44px; flex-shrink: 0; }
.big-num { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: var(--accent-soft); border-radius: 10px; padding-left: 10px; padding-right: 10px; border-bottom-color: transparent; }
.rank-pos { width: 2.25rem; flex-shrink: 0; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); }
.rank-row:nth-child(-n+3) .rank-pos { font-size: 1.125rem; }
.rank-name { flex: 1; min-width: 0; font-weight: 600; }
.rank-val { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.rank-val small { color: var(--muted); font-size: 0.75rem; }
.friends, .students, .checkin-list, .share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.friend-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.friend-row:last-child { border-bottom: 0; }
.friend-row .chip { margin-top: 6px; }
.avatar.sm { width: 40px; height: 40px; font-size: 0.95rem; }
.student-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: inherit; }
.students li:last-child .student-row { border-bottom: 0; }
.student-row:hover { background: var(--surface-2); border-radius: 10px; }
.student-row > .ico { color: var(--muted); }
.checkin-list li { padding: 8px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.checkin-list li:last-child { border-bottom: 0; }
.share-list { gap: 8px; }
.share-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.share-list .ico { color: var(--accent); margin-top: 2px; }
.share-list.no .ico { color: var(--danger); }
.chip.warn { background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.chip.danger { background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.card.accent .rank-row { border-bottom-color: var(--line); }
.a11y-contrast .rank-row.me { background: #161616; outline: 2px solid #d4ff3a; }
.a11y-contrast .chip.warn, .a11y-contrast .chip.danger { background: #000; border: 2px solid currentColor; }

/* ---------- Página de apresentação (antes do login) ---------- */
.returning #landing-ssr { display: none; }
.lp { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.lp-hero { padding: 18px 0 8px; }
.lp-hero h1 { font-size: clamp(2rem, 9vw, 2.75rem); line-height: 1.05; letter-spacing: -0.04em; margin: 8px 0 12px; }
.lp-sub { font-size: 1.0625rem; color: var(--muted); }
.lp-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 14px; }
.lp-ctas .btn { flex: 1 1 11rem; }
/* Link para baixar o app Android (versão de teste) */
.lp-android { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; }
.lp-android:hover { border-color: var(--accent); }
.lp-android .ic { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.lp-android .tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lp-android .tx small { color: var(--muted); font-size: 0.8125rem; }
.lp-android > .ico:last-child { color: var(--accent); flex-shrink: 0; }
.lp-trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.875rem; font-weight: 600; }
.lp-trust li { display: inline-flex; align-items: center; gap: 4px; }
.lp-trust .ico { color: var(--accent); }
.lp-section { margin-top: 18px; }
.lp-section > h2, .lp-section.card > h2 { font-size: 1.375rem; margin-bottom: 8px; }
.lp-example { margin-top: 12px; }
.lp-ex-title { font-size: 1.25rem; }
.lp-ex-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lp-ex-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lp-ex-list li:last-child { border-bottom: 0; }
.lp-ex-n { width: 28px; height: 28px; border-radius: 8px; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-weight: 800; font-size: 0.8125rem; flex-shrink: 0; }
.lp-ex-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-ex-name small, .lp-ex-sets small { color: var(--muted); font-size: 0.75rem; }
.lp-ex-sets { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; text-align: right; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lp-step { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.lp-step h3, .lp-feature h3 { font-size: 1rem; margin-bottom: 2px; }
.lp-step p, .lp-feature p { color: var(--muted); font-size: 0.9375rem; }
.lp-num { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--lime); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 10px; }
.lp-feature { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.lp-badges { margin-top: 12px; }
.lp-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lp-links a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lp-final { margin-top: 18px; }
.lp-final h2 { font-size: 1.375rem; }
.lp-foot { margin-top: 18px; text-align: center; }
.lp-foot p + p { margin-top: 6px; }

/* ---------- Desafio de 30 dias ---------- */
.missions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mission { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mission:last-child { border-bottom: 0; }
.badge-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.mission.done .badge-ic { background: var(--accent); color: var(--lime); }
.mission.done b { color: var(--accent); }
.a11y-contrast .mission.done .badge-ic { background: #d4ff3a; color: #000; }

/* Zona de exclusão de conta (Perfil) */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
