/* =========================================================================
   Bonde Move Club · tema compartilhado (versão escura "cores do site")
   Verde #FF2E93 só em destaques, botões principais e estados ativos.
   Celular primeiro, áreas de toque ≥ 44px e safe-area do iPhone.
   Fontes: Bebas Neue (títulos) e Barlow (corpo) — carregadas no <head> de cada página:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Bebas+Neue&display=swap" rel="stylesheet">
   ========================================================================= */

:root {
  /* superfícies */
  --bg: #111111;
  --bg-2: #0B0B0B;
  --card: #181818;
  --card-2: #141414;
  --elev: #1E1E1E;
  --linha: #232323;
  --linha-2: #2C2C2C;
  --linha-verde: rgba(255, 46, 147, .22);

  /* texto */
  --texto: #F0F0F0;
  --texto-2: #CFCFCF;
  --muted: #8A8A8A;
  --dim: #5F5F5F;

  /* marca */
  --verde: #FF2E93;
  --verde-escuro: #C2187A;
  --verde-suave: rgba(255, 46, 147, .10);
  --verde-tinta: rgba(255, 46, 147, .04);
  --sobre-verde: #1F0412;
  --rosa: #FF2E93;
  --laranja: #FF7A1A;
  --amarelo: #FFD400;
  --grad: linear-gradient(100deg, #FF1493 0%, #FF4D2E 45%, #FF8A00 72%, #FFD400 100%);
  --grad-suave: linear-gradient(135deg, rgba(255, 20, 147, .16), rgba(255, 138, 0, .10) 60%, rgba(255, 212, 0, .06));

  /* estados */
  --ok: #00B357;
  --ok-tinta: #3EDB86;
  --ambar: #E0A100;
  --ambar-tinta: #F2C14E;
  --ambar-suave: rgba(242, 182, 64, .10);
  --azul: #5AA8FF;
  --azul-tinta: #8CC1FF;
  --azul-suave: rgba(90, 168, 255, .12);
  --vermelho: #FF6B5E;
  --vermelho-suave: rgba(255, 107, 94, .10);

  /* forma */
  --r: 14px;
  --r-sm: 10px;
  --r-lg: 18px;
  --toque: 44px;
  --sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .35);
  --sombra-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 30px 70px -20px rgba(0, 0, 0, .8);

  /* tipografia */
  --fonte-titulo: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --fonte: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* safe-area */
  --sa-topo: env(safe-area-inset-top, 0px);
  --sa-base: env(safe-area-inset-bottom, 0px);
  --sa-esq: env(safe-area-inset-left, 0px);
  --sa-dir: env(safe-area-inset-right, 0px);

  --altura-topo: 56px;
  --altura-tabbar: 62px;

  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--verde); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

h1, h2, h3, .titulo {
  font-family: var(--fonte-titulo);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .95;
  text-transform: uppercase;
}
h1 { font-size: clamp(36px, 9vw, 56px); }
h2 { font-size: clamp(28px, 6vw, 40px); }
h3 { font-size: 24px; }
.destaque { color: var(--verde); }
.muted { color: var(--muted); }
.pequeno { font-size: 13px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.numero { font-family: var(--fonte-titulo); font-size: 32px; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.pagina {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--altura-topo) + var(--sa-topo) + 16px) calc(16px + var(--sa-dir)) calc(24px + var(--sa-base)) calc(16px + var(--sa-esq));
  display: flex; flex-direction: column; gap: 14px;
}
.pagina.com-tabbar { padding-bottom: calc(var(--altura-tabbar) + var(--sa-base) + 24px); }
.pagina.larga { max-width: 1180px; }
.pilha { display: flex; flex-direction: column; gap: 12px; }
.linha { display: flex; align-items: center; gap: 10px; }
.linha.entre { justify-content: space-between; }
.grade { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grade-2 { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }

/* ---------- topo ---------- */
.topo {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--altura-topo) + var(--sa-topo));
  padding: var(--sa-topo) calc(12px + var(--sa-dir)) 0 calc(12px + var(--sa-esq));
  display: flex; align-items: center; gap: 10px;
  background: rgba(17, 17, 17, .88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linha);
}
.topo .logo { width: 40px; height: 36px; flex: none; background: url("/shared/icones/logo.png") center / contain no-repeat; }
.topo .marca { font-family: var(--fonte-titulo); font-size: 22px; letter-spacing: .03em; line-height: 1; white-space: nowrap; }
.topo .marca span { color: var(--verde); }
.topo .acoes { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ---------- navegação lateral (painéis da equipe, telas largas) ---------- */
.nav-lateral { display: none; }
@media (min-width: 960px) {
  .com-lateral .nav-lateral {
    display: flex; flex-direction: column; gap: 4px;
    position: fixed; top: calc(var(--altura-topo) + var(--sa-topo)); bottom: 0; left: 0; width: 230px;
    padding: 16px 12px; border-right: 1px solid var(--linha); background: var(--bg-2); overflow-y: auto;
  }
  .com-lateral .pagina { margin-left: 230px; max-width: none; padding-left: 28px; padding-right: 28px; }
  .com-lateral .tabbar { display: none; }
}
.nav-lateral a {
  display: flex; align-items: center; gap: 10px; min-height: var(--toque); padding: 0 12px;
  border-radius: var(--r-sm); color: var(--texto-2); font-weight: 600; text-decoration: none;
}
.nav-lateral a:hover { background: var(--card); }
.nav-lateral a.ativo { background: var(--verde-suave); color: var(--verde); }

/* ---------- tab bar inferior ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: flex; justify-content: space-around;
  padding: 6px calc(4px + var(--sa-dir)) calc(6px + var(--sa-base)) calc(4px + var(--sa-esq));
  background: #121212; border-top: 1px solid #222;
}
.tabbar a, .tabbar button {
  flex: 1; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: #7A7A7A; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .ativo { color: var(--verde); }

/* ---------- ícones ---------- */
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--toque); padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--linha-2); background: var(--card); color: var(--texto);
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; user-select: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: #3A3A3A; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.primario { background: var(--grad); border-color: transparent; color: var(--sobre-verde); font-weight: 700; }
.btn.primario:hover { filter: brightness(1.08); }
.grad-texto { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn.secundario { background: transparent; border-color: var(--linha-verde); color: var(--verde); }
.btn.fantasma { background: transparent; border-color: transparent; color: var(--texto-2); }
.btn.perigo { background: transparent; border-color: rgba(255, 107, 94, .4); color: var(--vermelho); }
.btn.bloco { width: 100%; }
.btn.pequeno { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.icone { width: var(--toque); padding: 0; }
.btn.carregando { pointer-events: none; opacity: .7; }
.btn.carregando::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- card ---------- */
.card {
  background: var(--card); border: 1px solid var(--linha-verde); border-radius: var(--r);
  padding: 16px; box-shadow: var(--sombra);
}
.card.plano { box-shadow: none; }
.card.neutro { border-color: var(--linha); }
.card.destaque-card { background: linear-gradient(135deg, rgba(255, 46, 147, .06), #181818 60%); }
.card .cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card .cabecalho .kicker { margin: 0; }

/* ---------- chip / pill ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--linha-2); background: var(--card);
  font-size: 12px; font-weight: 700; color: var(--texto-2); white-space: nowrap;
}
button.chip { cursor: pointer; min-height: 36px; }
.chip.ativo, .chip.verde { background: var(--verde-suave); border-color: rgba(255, 46, 147, .4); color: var(--verde); }
.chip.ambar { background: var(--ambar-suave); border-color: rgba(242, 193, 78, .4); color: var(--ambar-tinta); }
.chip.azul { background: var(--azul-suave); border-color: rgba(90, 168, 255, .35); color: var(--azul-tinta); }
.chip.vermelho { background: var(--vermelho-suave); border-color: rgba(255, 107, 94, .4); color: var(--vermelho); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .rotulo { font-size: 13px; font-weight: 700; color: var(--texto-2); }
.campo .ajuda { font-size: 12px; color: var(--muted); }
.campo .erro-campo { font-size: 12px; color: var(--vermelho); }
.input, input.input, select.input, textarea.input {
  width: 100%; min-height: var(--toque); padding: 10px 14px;
  background: var(--card-2); border: 1px solid var(--linha-2); border-radius: 12px; color: var(--texto);
  font-size: 16px; /* 16px evita zoom no iOS */
}
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-suave); }
.input[aria-invalid="true"] { border-color: var(--vermelho); }

/* toggle (checkbox) */
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: var(--toque); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .trilho { width: 46px; height: 28px; border-radius: 999px; background: #2A2A2A; position: relative; flex: none; transition: background .15s; }
.toggle .trilho::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #BDBDBD; transition: transform .15s, background .15s; }
.toggle input:checked + .trilho { background: var(--verde); }
.toggle input:checked + .trilho::after { transform: translateX(18px); background: var(--sobre-verde); }
.toggle input:focus-visible + .trilho { outline: 2px solid var(--verde); outline-offset: 2px; }

/* controle segmentado (ex.: Casa | Academia) */
.seg { display: flex; background: var(--card-2); border: 1px solid var(--linha); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; min-height: 38px; border: 0; background: none; border-radius: 9px; color: var(--muted); font-weight: 700; cursor: pointer; }
.seg button.ativo { background: #2A2A2A; color: var(--texto); }

/* escala 1–5 (check-in) */
.escala { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.escala button { min-height: var(--toque); border-radius: 10px; border: 1px solid var(--linha-2); background: var(--card-2); font-weight: 700; cursor: pointer; }
.escala button.ativo { background: var(--verde); border-color: var(--verde); color: var(--sobre-verde); }

/* ---------- lista ---------- */
.lista { list-style: none; display: flex; flex-direction: column; }
.lista > li, .lista > .item {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 2px;
  border-bottom: 1px solid var(--linha);
}
.lista > li:last-child, .lista > .item:last-child { border-bottom: 0; }
.lista .corpo { flex: 1; min-width: 0; }
.lista .corpo .t { font-weight: 700; }
.lista .corpo .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista a.item { color: inherit; text-decoration: none; }

/* ---------- avatar com iniciais ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; background: #232323; color: var(--texto-2);
}
.avatar.p { width: 28px; height: 28px; font-size: 11px; }
.avatar.g { width: 64px; height: 64px; font-size: 22px; }
.avatar.c1 { background: #12301F; color: #7CE8AE; }
.avatar.c2 { background: #1A2438; color: #9DBDF5; }
.avatar.c3 { background: #33261A; color: #E6B98A; }
.avatar.c4 { background: #16302A; color: #8FD9BF; }
.avatar.c5 { background: #2D1D33; color: #D9A7E8; }
.avatar.c6 { background: #2E2B17; color: #DCCF85; }
.avatar.c7 { background: #262626; color: #BDBDBD; }
.pilha-avatares { display: flex; }
.pilha-avatares .avatar { border: 2px solid var(--card); margin-left: -8px; }
.pilha-avatares .avatar:first-child { margin-left: 0; }

/* ---------- barra de progresso ---------- */
.progresso { height: 8px; border-radius: 999px; background: #2A2A2A; overflow: hidden; }
.progresso > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--verde); transition: width .3s; }
.progresso.fino { height: 4px; }

/* ---------- skeleton ---------- */
.skeleton {
  border-radius: 10px; min-height: 16px;
  background: linear-gradient(90deg, #1A1A1A 0%, #242424 50%, #1A1A1A 100%); background-size: 200% 100%;
  animation: brilho 1.3s ease-in-out infinite;
}
.skeleton.bloco { min-height: 96px; border-radius: var(--r); }
.skeleton.linha-curta { width: 40%; }
@keyframes brilho { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }

/* ---------- estado vazio ---------- */
.vazio { text-align: center; padding: 32px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vazio .ico { width: 40px; height: 40px; color: var(--dim); }
.vazio .t { color: var(--texto); font-weight: 700; font-size: 17px; }

/* ---------- modal / sheet ---------- */
.fundo-modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .6);
  display: flex; align-items: flex-end; justify-content: center;
  animation: aparecer .15s ease-out;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--linha-verde); border-bottom: 0;
  border-radius: 20px 20px 0 0; padding: 10px 16px calc(20px + var(--sa-base));
  box-shadow: var(--sombra-lg); animation: subir .2s ease-out;
}
.sheet:focus { outline: none; }
.sheet .alca { width: 40px; height: 5px; border-radius: 999px; background: #3A3A3A; margin: 2px auto 12px; }
.sheet .cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
@media (min-width: 720px) {
  .fundo-modal { align-items: center; }
  .sheet { border-radius: 20px; border-bottom: 1px solid var(--linha-verde); padding-bottom: 20px; }
}
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(24px); opacity: .6; } }

/* ---------- toast ---------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100;
  bottom: calc(var(--altura-tabbar) + var(--sa-base) + 14px);
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: #202020; border: 1px solid var(--linha-2);
  box-shadow: var(--sombra-lg); font-weight: 600; font-size: 14px; animation: subir .2s ease-out;
}
.toast.sucesso { border-color: rgba(255, 46, 147, .45); }
.toast.sucesso::before { content: "✓"; color: var(--verde); font-weight: 700; }
.toast.erro { border-color: rgba(255, 107, 94, .5); }
.toast.erro::before { content: "!"; color: var(--vermelho); font-weight: 700; }

/* ---------- utilidades de status ---------- */
.ok { color: var(--ok-tinta); }
.alerta { color: var(--ambar-tinta); }
.perigo-texto { color: var(--vermelho); }
.divisor { height: 1px; background: var(--linha); margin: 4px 0; }
.aviso-fixo { font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- tela de carregamento ---------- */
.carregando-tela { min-height: 60dvh; display: grid; place-items: center; }
.carregando-tela .logo-grande { width: 120px; height: 110px; background: url("/shared/icones/logo.png") center / contain no-repeat; animation: pulsar 1.6s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: .55; transform: scale(.97); } }
