/* Flow VA'A — tokens e estilos compartilhados (site, painel e portais) */
:root {
  --fv-lagoon: #0E4D64;     /* primária (pode ser sobrescrita pela cor da federação) */
  --fv-reef: #1F8A8A;
  --fv-ama: #F2B705;        /* amarelo do flutuador: ao vivo, destaque, 1º lugar */
  --fv-basalt: #1C2A33;
  --fv-foam: #EAF4F2;
  --fv-line: #D6E2E1;
  --fv-muted: #5B6B73;
  --fv-danger: #B42318;
  --fv-radius: 10px;
  --fv-display: "Big Shoulders Display", "Barlow Condensed", "Arial Narrow", sans-serif;
  --fv-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-primary: var(--fv-lagoon);
  --bs-link-color: var(--fv-lagoon);
  --bs-link-hover-color: var(--fv-reef);
  --bs-body-font-family: var(--fv-body);
  --bs-body-color: var(--fv-basalt);
  --bs-border-color: var(--fv-line);
}
body { font-family: var(--fv-body); color: var(--fv-basalt); font-size: 1rem; line-height: 1.55; }
h1, h2, h3, .display-font { font-family: var(--fv-display); font-weight: 800; letter-spacing: .01em; line-height: 1.05; }
h4, h5, h6 { font-weight: 600; }
.tnum, .tempo, table .num { font-variant-numeric: tabular-nums; }
a { text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--fv-ama) !important; outline-offset: 2px; }

/* Botões e cores */
.btn-primary { --bs-btn-bg: var(--fv-lagoon); --bs-btn-border-color: var(--fv-lagoon); --bs-btn-hover-bg: var(--fv-reef); --bs-btn-hover-border-color: var(--fv-reef); --bs-btn-active-bg: var(--fv-basalt); }
.btn-outline-primary { --bs-btn-color: var(--fv-lagoon); --bs-btn-border-color: var(--fv-lagoon); --bs-btn-hover-bg: var(--fv-lagoon); --bs-btn-hover-border-color: var(--fv-lagoon); }
.btn-ama { background: var(--fv-ama); color: var(--fv-basalt); border: 0; font-weight: 700; }
.btn-ama:hover { background: #ffc61a; color: var(--fv-basalt); }
.text-lagoon { color: var(--fv-lagoon) !important; }
.bg-lagoon { background: var(--fv-lagoon) !important; color: #fff; }
.bg-foam { background: var(--fv-foam) !important; }
.text-muted-fv { color: var(--fv-muted) !important; }
.badge { font-weight: 600; }

/* Ao vivo */
.live-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #E5322D; margin-right: .4rem; vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: fvpulse 1.4s ease-in-out infinite; } }
@keyframes fvpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,50,45,.55); } 50% { box-shadow: 0 0 0 .45rem rgba(229,50,45,0); } }
.btn-live { background: var(--fv-ama); color: var(--fv-basalt); font-weight: 800; font-family: var(--fv-display); font-size: 1.05rem; letter-spacing: .03em; border-radius: 999px; padding: .35rem 1rem; white-space: nowrap; display: inline-flex; align-items: center; }
.btn-live:hover { background: #ffc61a; }

/* WhatsApp flutuante */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 1040; width: 58px; height: 58px; border-radius: 50%; background: #1FA855; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.wa-float:hover { color: #fff; background: #178a45; }

/* Placar de resultados (elemento assinatura) */
.placar { width: 100%; border-collapse: separate; border-spacing: 0; }
.placar th { font-size: .78rem; color: var(--fv-muted); font-weight: 600; border-bottom: 2px solid var(--fv-basalt); padding: .45rem .5rem; white-space: nowrap; }
.placar td { padding: .55rem .5rem; border-bottom: 1px solid var(--fv-line); vertical-align: middle; }
.placar .pos { font-family: var(--fv-display); font-weight: 800; font-size: 1.6rem; width: 3.2rem; text-align: center; line-height: 1; }
.placar tr.p1 .pos { background: var(--fv-ama); color: var(--fv-basalt); }
.placar tr.p2 .pos { background: #D9DFE2; }
.placar tr.p3 .pos { background: #E9C9A3; }
.placar .tempo { font-family: var(--fv-display); font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.placar .dif { color: var(--fv-muted); font-size: .85rem; }
.placar .sit { font-family: var(--fv-display); font-weight: 800; color: var(--fv-danger); }
.placar .competidor { font-weight: 600; }
.placar .integrantes { font-size: .82rem; color: var(--fv-muted); }

/* Componentes gerais */
.card { border-color: var(--fv-line); border-radius: var(--fv-radius); }
.card-header { background: transparent; font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--fv-foam); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--fv-lagoon); font-size: .9rem; flex: none; }
.avatar-lg { width: 96px; height: 96px; font-size: 1.8rem; }
.thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--fv-foam); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.form-text { font-size: .8rem; }
.required::after { content: " *"; color: var(--fv-danger); }
.table > :not(caption) > * > * { padding: .55rem .6rem; }
.table thead th { font-size: .8rem; color: var(--fv-muted); font-weight: 600; white-space: nowrap; }
.map-picker { height: 300px; border-radius: 8px; border: 1px solid var(--fv-line); }
.pix-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; background: var(--fv-foam); border-radius: 8px; padding: .75rem; max-height: 9rem; overflow: auto; }
.qr-pix { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--fv-line); }

/* Painel administrativo */
.admin-body { background: #F4F7F7; }
.admin-sidebar { width: 252px; background: var(--fv-basalt); color: #C9D5DA; min-height: 100vh; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 1030; }
.admin-sidebar .brand { font-family: var(--fv-display); font-weight: 800; font-size: 1.45rem; color: #fff; padding: 1rem 1.1rem .4rem; display: flex; gap: .6rem; align-items: center; text-decoration: none; }
.admin-sidebar .brand img { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.admin-sidebar .fed-name { font-size: .8rem; color: #93A6AE; padding: 0 1.1rem .8rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-sidebar .grupo { font-size: .74rem; color: #7F959E; padding: .9rem 1.1rem .3rem; font-weight: 600; }
.admin-sidebar a.item { display: flex; align-items: center; gap: .65rem; color: #D3DEE2; text-decoration: none; padding: .42rem 1.1rem; font-size: .93rem; border-left: 3px solid transparent; }
.admin-sidebar a.item:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-sidebar a.item.active { background: rgba(31,138,138,.22); color: #fff; border-left-color: var(--fv-ama); }
.admin-main { margin-left: 252px; min-height: 100vh; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--fv-line); padding: .6rem 1.4rem; position: sticky; top: 0; z-index: 1020; }
.admin-content { padding: 1.4rem; max-width: 1400px; }
.page-title { font-size: 2rem; margin: 0; }
.stat { background: #fff; border: 1px solid var(--fv-line); border-radius: var(--fv-radius); padding: 1rem 1.1rem; height: 100%; display: block; color: inherit; text-decoration: none; }
.stat .valor { font-family: var(--fv-display); font-size: 2.1rem; font-weight: 800; line-height: 1; }
.stat .rotulo { color: var(--fv-muted); font-size: .88rem; }
.stat:hover { border-color: var(--fv-reef); }
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .admin-sidebar.show { transform: none; }
  .admin-main { margin-left: 0; }
}

/* Apuração */
.apuracao input.tempo-input { font-family: var(--fv-display); font-size: 1.2rem; font-weight: 700; width: 9rem; text-align: center; }
.apuracao tr.ok-salvo td { background: #F1FAF7; }
.apuracao .pos-auto { font-family: var(--fv-display); font-size: 1.4rem; font-weight: 800; width: 3rem; text-align: center; }

/* Carteirinha */
.carteirinha { max-width: 420px; border-radius: 14px; overflow: hidden; border: 1px solid var(--fv-line); background: #fff; }
.carteirinha .topo { background: var(--fv-lagoon); color: #fff; padding: .8rem 1rem; display: flex; align-items: center; gap: .7rem; }

/* Site público */
.site-header { background: #fff; border-bottom: 1px solid var(--fv-line); }
.site-header .navbar-brand img { height: 44px; width: auto; }
.site-header .navbar-brand span { font-family: var(--fv-display); font-weight: 800; font-size: 1.35rem; color: var(--fv-basalt); line-height: 1; }
.site-header .nav-link { font-weight: 600; color: var(--fv-basalt); white-space: nowrap; font-size: .95rem; }
.site-header .btn { white-space: nowrap; }
@media (min-width: 1200px) { .site-header .navbar-nav .nav-link { padding-left: .45rem; padding-right: .45rem; } }
.site-header .nav-link.active, .site-header .nav-link:hover { color: var(--fv-lagoon); }
.hero { position: relative; color: #fff; background: var(--fv-basalt); overflow: hidden; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .45; }
.hero .inner { position: relative; padding: 5rem 0 4rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); max-width: 16ch; }
.hero .meta { font-size: 1.15rem; color: #E3ECEE; }
.secao { padding: 3.5rem 0; }
.secao-titulo { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-bottom: 1.2rem; }
.etapa-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--fv-line); border-radius: var(--fv-radius); overflow: hidden; background: #fff; height: 100%; }
.etapa-card:hover { border-color: var(--fv-lagoon); }
.etapa-card img, .etapa-card .sem-foto { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: linear-gradient(135deg, var(--fv-lagoon), var(--fv-reef)); }
.etapa-card .data { font-family: var(--fv-display); font-size: 1.4rem; font-weight: 800; color: var(--fv-lagoon); }
.membro img, .membro .avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; }
.site-footer { background: var(--fv-basalt); color: #C9D5DA; padding: 3rem 0 1.5rem; }
.site-footer a { color: #fff; }
.site-footer h5 { color: #fff; font-family: var(--fv-display); font-size: 1.3rem; font-weight: 800; }
.galeria-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.galeria-grid a img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.prose { max-width: 72ch; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.mapa-bases { height: 460px; border-radius: var(--fv-radius); border: 1px solid var(--fv-line); }
.ratio-live { aspect-ratio: 16/9; width: 100%; border: 0; border-radius: var(--fv-radius); background: #000; }

@media print {
  .admin-sidebar, .admin-topbar, .site-header, .site-footer, .wa-float, .no-print { display: none !important; }
  .admin-main { margin-left: 0; }
}

/* Componentes do Bootstrap na paleta da federação */
.nav-pills { --bs-nav-pills-link-active-bg: var(--fv-lagoon); }
.nav-link { color: var(--fv-lagoon); }
.nav-link:hover, .nav-link:focus { color: var(--fv-reef); }
.nav-tabs .nav-link.active { color: var(--fv-basalt); font-weight: 600; }
.form-check-input:checked { background-color: var(--fv-lagoon); border-color: var(--fv-lagoon); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--fv-reef); box-shadow: 0 0 0 .2rem rgba(31, 138, 138, .22); }
.dropdown-item.active, .dropdown-item:active { background-color: var(--fv-lagoon); }
.pagination { --bs-pagination-color: var(--fv-lagoon); --bs-pagination-hover-color: var(--fv-reef); --bs-pagination-active-bg: var(--fv-lagoon); --bs-pagination-active-border-color: var(--fv-lagoon); }
.list-group-item.active { background-color: var(--fv-lagoon); border-color: var(--fv-lagoon); }
.bg-primary { background-color: var(--fv-lagoon) !important; }
.text-primary { color: var(--fv-lagoon) !important; }
.border-primary { border-color: var(--fv-lagoon) !important; }
