/* ============================================================
   GE - ACADEMY · Fluent 2 Design System
   Tokens e componentes no padrão Fluent 2 (Microsoft)
   ============================================================ */

/* ---------- Reset de caixa: evita estouro de layout ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
img, svg, video, canvas { max-width: 100%; height: auto; }

:root {
    /* --- Marca (Fluent 2 Brand) --- */
    --f-primary: #0f6cbd;
    --f-primary-hover: #115ea3;
    --f-primary-active: #0c3b5e;
    --f-primary-soft: #ebf3fc;
    --f-accent: #0078d4;

    /* --- Neutros (Fluent 2 Neutral, rampa de contraste AA) --- */
    --f-text: #242424;
    --f-text-2: #424242;
    --f-text-3: #616161;
    --f-surface: #ffffff;
    --f-surface-2: #f5f5f5;
    --f-surface-3: #ededed;
    --f-border: #e0e0e0;
    --f-border-2: #c7c7c7;

    /* --- Semânticos (Fluent 2) --- */
    --f-danger: #d13438;
    --f-danger-hover: #a4262c;
    --f-danger-soft: #fde7e9;
    --f-success: #107c10;
    --f-success-hover: #0b6a0b;
    --f-success-soft: #dff6dd;
    --f-warning: #f7630c;
    --f-warning-soft: #fff4ce;

    /* --- Cantos: escala oficial Fluent 2 (4 / 8 / 12 / 16) --- */
    --f-radius-xs: 4px;
    --f-radius: 8px;
    --f-radius-lg: 12px;
    --f-radius-xl: 16px;
    --f-radius-sm: var(--f-radius);

    /* --- Elevação: camadas do Fluent 2 --- */
    --f-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    --f-shadow-md: 0 2px 4px rgba(0, 0, 0, .06), 0 0 2px rgba(0, 0, 0, .10);
    --f-shadow-lg: 0 8px 16px rgba(0, 0, 0, .10), 0 0 2px rgba(0, 0, 0, .08);
    --f-shadow-xl: 0 32px 64px rgba(0, 0, 0, .14), 0 0 2px rgba(0, 0, 0, .08);
    --f-ring: 0 0 0 2px var(--f-surface), 0 0 0 4px var(--f-primary);

    /* --- Movimento: curvas oficiais do Fluent 2 --- */
    --f-decelerate: cubic-bezier(.1, .9, .2, 1);
    --f-accelerate: cubic-bezier(.9, 0, 1, 1);
    --f-standard: cubic-bezier(.33, 0, .67, 1);
    --f-dur: .15s;
    --f-dur-slow: .25s;

    --f-font: 'Segoe UI Variable', 'Segoe UI', 'Plus Jakarta Sans',
              ui-sans-serif, system-ui, sans-serif;
}

/* Botão Salvar/Cancelar semanticos: garante a regra de cor em QUALQUER tela */
.f-btn-salvar { background: var(--f-success); color: #fff; }
.f-btn-salvar:hover { background: var(--f-success-hover); }
.f-btn-cancelar { background: var(--f-danger); color: #fff; }
.f-btn-cancelar:hover { background: var(--f-danger-hover); }

/* ---------- Superfícies e cards ---------- */
.f-card {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-lg);
    box-shadow: var(--f-shadow);
}
.f-card-flat {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius);
}
.f-card-hd {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--f-border);
}
.f-card-bd { padding: 16px 18px; }
.f-panel { background: var(--f-surface-2); border: 1px solid var(--f-border); border-radius: var(--f-radius); }

/* ---------- Botões (command bar do Fluent) ---------- */
.f-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-family: inherit;
    font-size: .8rem; font-weight: 600; line-height: 1.2;
    padding: 8px 14px; border-radius: var(--f-radius);
    border: 1px solid transparent; cursor: pointer;
    transition: background var(--f-dur) var(--f-standard),
                border-color var(--f-dur) var(--f-standard),
                color var(--f-dur) var(--f-standard),
                box-shadow var(--f-dur) var(--f-standard),
                transform var(--f-dur) var(--f-standard);
    white-space: nowrap;
}
.f-btn:active { transform: scale(.97); transition-duration: .05s; }
.f-btn:focus-visible { outline: none; box-shadow: var(--f-ring); }
.f-btn.sm, .f-btn-sm { padding: 5px 11px; font-size: .75rem; border-radius: var(--f-radius); }
.f-btn.lg, .f-btn-lg { padding: 11px 18px; font-size: .85rem; }
.f-btn.icon, .f-btn-icon { padding: 0; width: 32px; height: 32px; border-radius: var(--f-radius); }
.f-btn-primary { background: var(--f-primary); color: #fff; }
.f-btn-primary:hover { background: var(--f-primary-hover); }
.f-btn-secondary { background: var(--f-surface); border-color: var(--f-border-2); color: var(--f-text-2); }
.f-btn-secondary:hover { background: var(--f-surface-2); border-color: var(--f-text-3); color: var(--f-text); }
.f-btn-ghost { background: transparent; color: var(--f-text-2); }
.f-btn-ghost:hover { background: rgba(0, 0, 0, .06); color: var(--f-text); }
.f-btn-accent { background: var(--f-primary-soft); color: var(--f-primary); }
.f-btn-accent:hover { background: #d5e5f7; }
.f-btn-danger { background: var(--f-danger); color: #fff; }
.f-btn-danger:hover { background: var(--f-danger-hover); }
.f-btn-danger-ghost { background: var(--f-danger-soft); color: var(--f-danger); }
.f-btn-danger-ghost:hover { background: #fac7c9; }
.f-btn-success { background: var(--f-success); color: #fff; }
.f-btn-success:hover { background: var(--f-success-hover); }
.f-btn-success-ghost { background: var(--f-success-soft); color: var(--f-success); }
.f-btn-success-ghost:hover { background: #c7efc7; }
.f-btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- Switch (Fluent 2 ToggleSwitch) ---------- */
.f-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.f-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.f-switch .f-track {
    width: 40px; height: 20px; border-radius: 999px; flex-shrink: 0;
    background: var(--f-surface-3); border: 1px solid var(--f-text-3);
    position: relative; transition: background var(--f-dur) var(--f-standard),
                                    border-color var(--f-dur) var(--f-standard);
}
.f-switch .f-thumb {
    position: absolute; top: 50%; left: 3px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--f-text-2);
    transform: translate(0, -50%);
    transition: transform var(--f-dur) var(--f-decelerate),
                width var(--f-dur) var(--f-decelerate),
                background var(--f-dur) var(--f-standard);
}
.f-switch input:checked + .f-track { background: var(--f-primary); border-color: var(--f-primary); }
.f-switch input:checked + .f-track .f-thumb { transform: translate(20px, -50%); background: #fff; }
.f-switch input:focus-visible + .f-track { box-shadow: var(--f-ring); }
.f-switch:hover .f-track { border-color: var(--f-text); }
.f-switch .f-switch-label { font-size: .8rem; font-weight: 600; color: var(--f-text); }

/* ---------- Alerta / Banner (Fluent 2 InfoBar) ---------- */
.f-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px; border-radius: var(--f-radius);
    border: 1px solid var(--f-border); background: var(--f-surface-2);
    font-size: .8rem; font-weight: 600; color: var(--f-text);
}
.f-alert .fi { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.f-alert.info { background: var(--f-primary-soft); border-color: #c7e0f7; color: #0c3b5e; }
.f-alert.info .fi { color: var(--f-primary); }
.f-alert.success { background: var(--f-success-soft); border-color: #b7dfb7; color: #0b5a0b; }
.f-alert.success .fi { color: var(--f-success); }
.f-alert.warning { background: var(--f-warning-soft); border-color: #ffe08b; color: #7a3e00; }
.f-alert.warning .fi { color: var(--f-warning); }
.f-alert.danger { background: var(--f-danger-soft); border-color: #f5b7bb; color: #7c1d20; }
.f-alert.danger .fi { color: var(--f-danger); }

/* ---------- Dica sobre ícone/botão (Fluent 2 Tooltip) ---------- */
.f-tip { position: relative; }
.f-tip::after {
    content: attr(data-tip);
    position: absolute; left: 50%; bottom: calc(100% + 7px);
    transform: translateX(-50%) translateY(3px);
    background: var(--f-text); color: #fff;
    font-size: .68rem; font-weight: 600; line-height: 1.3;
    padding: 5px 9px; border-radius: var(--f-radius-xs);
    white-space: nowrap; pointer-events: none;
    opacity: 0; z-index: 60;
    transition: opacity var(--f-dur) var(--f-standard), transform var(--f-dur) var(--f-decelerate);
    box-shadow: var(--f-shadow-md);
}
.f-tip:hover::after, .f-tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.f-tip-bottom::after { bottom: auto; top: calc(100% + 7px); }

/* ---------- Tela de login (Fluent 2) ---------- */
/* Fundo claro e sereno (padrao Fluent), com mancha de marca suave atras.
   Nada de gradiente escuro pesado: a tela e de entrada, nao de impacto. */
.f-login {
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    position: relative; overflow: hidden;
    background: var(--f-surface-2);
}
.f-login-fundo { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.f-login-fundo::before, .f-login-fundo::after {
    content: ''; position: absolute; border-radius: 50%;
    filter: blur(70px); opacity: .5;
}
.f-login-fundo::before { width: 420px; height: 420px; top: -140px; right: -120px; }
.f-login-fundo::after  { width: 380px; height: 380px; bottom: -150px; left: -120px; }
.f-login[data-painel="academia"] .f-login-fundo::before,
.f-login[data-painel="academia"] .f-login-fundo::after { background: #2563eb; }
.f-login[data-painel="master"] .f-login-fundo::before,
.f-login[data-painel="master"] .f-login-fundo::after { background: #475569; }
.f-login[data-painel="aluno"] .f-login-fundo::before,
.f-login[data-painel="aluno"] .f-login-fundo::after { background: #0d9488; }

.f-login-caixa { position: relative; z-index: 1; width: 100%; max-width: 418px; }
.f-login-marca { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.f-login-logo {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 21px; box-shadow: var(--f-shadow-md);
}
.f-login[data-painel="academia"] .f-login-logo { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.f-login[data-painel="master"]  .f-login-logo { background: linear-gradient(135deg, #475569, #1e293b); }
.f-login[data-painel="aluno"]   .f-login-logo { background: linear-gradient(135deg, #0d9488, #0f766e); }
.f-login-nome  { font-size: 1.02rem; font-weight: 700; color: var(--f-text); line-height: 1.25; }
.f-login-sub   { font-size: .68rem; font-weight: 600; color: var(--f-text-3);
                 letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

.f-login-card {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-xl);
    box-shadow: var(--f-shadow-lg);
    overflow: hidden;
}
/* faixa de cor fina no topo: identifica o painel sem gritar */
.f-login-card::before { content: ''; display: block; height: 4px; }
.f-login[data-painel="academia"] .f-login-card::before { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.f-login[data-painel="master"]  .f-login-card::before { background: linear-gradient(90deg, #475569, #94a3b8); }
.f-login[data-painel="aluno"]   .f-login-card::before { background: linear-gradient(90deg, #0d9488, #34d399); }
.f-login-corpo { padding: 24px 26px 26px; }
.f-login-titulo { font-size: 1.15rem; font-weight: 700; color: var(--f-text); letter-spacing: -.01em; }
.f-login-desc   { font-size: .8rem; font-weight: 600; color: var(--f-text-3); margin-top: 3px; }
.f-login-campo  { margin-top: 16px; }
.f-login-dica   { margin-top: 6px; font-size: .7rem; font-weight: 600;
                  color: var(--f-text-3); display: flex; align-items: center; gap: 5px; }
.f-login-dica i { font-size: .7rem; }
.f-login-rodape { padding: 14px 26px; border-top: 1px solid var(--f-border);
                  background: var(--f-surface-2); display: flex; justify-content: center; }
.f-login-rodape a { font-size: .78rem; font-weight: 600; color: var(--f-text-3);
                    display: inline-flex; align-items: center; gap: 6px;
                    transition: color var(--f-dur) var(--f-standard); }
.f-login-rodape a:hover { color: var(--f-primary); }
.f-login-nota { text-align: center; font-size: .72rem; font-weight: 600;
                color: var(--f-text-3); margin-top: 16px;
                display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- Inputs / Form ---------- */
.f-label {
    display: block; font-size: .7rem; font-weight: 600; letter-spacing: .03em;
    text-transform: uppercase; color: var(--f-text-2); margin-bottom: 6px;
}
.f-input, .f-select, .f-textarea {
    width: 100%; font-family: var(--f-font); font-size: .85rem; font-weight: 600;
    color: var(--f-text); background: var(--f-surface);
    border: 1px solid var(--f-border-2); border-radius: var(--f-radius-sm);
    padding: 9px 12px; transition: border-color .15s ease, box-shadow .15s ease; outline: none;
}
.f-input::placeholder, .f-textarea::placeholder { color: var(--f-text-3); font-weight: 600; }
.f-input:focus, .f-select:focus, .f-textarea:focus { border-color: var(--f-primary); box-shadow: var(--f-ring); }
.f-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.f-input-icon { position: relative; }
.f-input-icon > .fi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--f-text-3); font-size: 15px; pointer-events: none; }
.f-input-icon .f-input { padding-left: 38px; }

/* ---------- Badges / Pills ---------- */
.f-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .68rem; font-weight: 800; letter-spacing: .02em;
    padding: 3px 10px; border-radius: 999px;
    background: var(--f-primary-soft); color: var(--f-primary);
    border: 1px solid transparent;
}
.f-badge.green { background: var(--f-success-soft); color: var(--f-success); }
.f-badge.red { background: var(--f-danger-soft); color: var(--f-danger); }
.f-badge.amber { background: var(--f-warning-soft); color: var(--f-warning); }
.f-badge.gray { background: #f1f5f9; color: #64748b; }
.f-badge.indigo { background: #eef2ff; color: #4f46e5; }
.f-badge.violet { background: #f5f3ff; color: #7c3aed; }
.f-badge.teal { background: #f0fdfa; color: #0d9488; }
.f-badge.rose { background: #fff1f2; color: #e11d48; }
.f-badge.blue { background: #eff6ff; color: #2563eb; }

/* ---------- Tabelas ---------- */
.f-table-w { overflow-x: auto; border-radius: var(--f-radius-sm); }
.f-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.f-table th {
    text-align: left; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: var(--f-text-3); background: var(--f-surface-2);
    padding: 10px 14px; border-bottom: 1px solid var(--f-border); white-space: nowrap;
}
.f-table td { padding: 11px 14px; border-bottom: 1px solid var(--f-border); color: var(--f-text); vertical-align: middle; }
.f-table tbody tr:hover td { background: #f8fafc; }
.f-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Header / Navegação (NavigationView) ---------- */
.f-topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--f-border);
}
.f-tab {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .78rem; font-weight: 700; color: var(--f-text-2);
    padding: 7px 12px; border-radius: 9px; white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.f-tab:hover { background: rgba(15, 23, 42, .06); color: var(--f-text); }
.f-tab.active { background: var(--f-primary-soft); color: var(--f-primary); }
.f-tab.active .fi { color: var(--f-primary); }
.f-tab .fi { font-size: 14px; color: var(--f-text-3); }

/* ---------- Page header / Hero ---------- */
.f-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.f-hero-tile {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--f-primary), var(--f-accent));
    color: #fff; box-shadow: var(--f-shadow-md); font-size: 22px;
}
.f-hero h1 { font-size: 1.25rem; font-weight: 800; color: var(--f-text); letter-spacing: -.01em; }
.f-hero p { font-size: .78rem; font-weight: 600; color: var(--f-text-2); margin-top: 2px; }

/* ---------- Stats / KPIs ---------- */
.f-stat {
    background: var(--f-surface); border: 1px solid var(--f-border); border-radius: var(--f-radius);
    box-shadow: var(--f-shadow); padding: 16px 18px;
    display: flex; align-items: center; gap: 14px;
}
.f-stat-tile { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.f-stat .f-stat-label { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--f-text-3); }
.f-stat .f-stat-value { font-size: 1.45rem; font-weight: 800; color: var(--f-text); line-height: 1.1; }

/* ---------- Seções ---------- */
.f-sec-title { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--f-text-2); margin-bottom: 10px; }
.f-sec-title .fi { color: var(--f-primary); font-size: 15px; }
.f-divider { height: 1px; background: var(--f-border); border: 0; margin: 14px 0; }

/* ---------- Modal ---------- */
.f-modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px);
    overflow-y: auto;
}
.f-modal-card {
    background: var(--f-surface); border-radius: 16px; box-shadow: var(--f-shadow-lg);
    width: 100%; max-width: 560px; overflow: hidden;
    max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
    animation: f-pop .22s cubic-bezier(.2, .8, .3, 1);
}
.f-modal-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--f-border); flex-shrink: 0; }
/* O CORPO e a UNICA regiao que rola. Cabecalho e rodape ficam fixos, entao a
   barra de rolagem nasce DENTRO do modal, junto do conteudo -- e o topo/acoes
   nunca somem quando a tela tem campos demais. */
.f-modal-bd {
    padding: 20px;
    flex: 1 1 auto;
    min-height: 0;                 /* permite ao flex encolher e habilitar o overflow */
    overflow-y: auto;
    overscroll-behavior: contain;   /* nao \"arrasta\" a pagina de tras ao chegar na borda */
    scrollbar-gutter: stable;      /* evita o conteudo \"pular\" quando a barra aparece */
}
.f-modal-ft { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--f-border); background: var(--f-surface-2); flex-shrink: 0; }
.f-modal-card > *:last-child:not(.f-modal-bd) { margin-top: auto; }
@keyframes f-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Barra de rolagem Fluent 2: fina, discreta e integrada a superficie */
.f-modal-bd, .modal-box, .f-scroll, body {
    scrollbar-width: thin;
    scrollbar-color: var(--f-border-2) transparent;
}
.f-modal-bd::-webkit-scrollbar, .modal-box::-webkit-scrollbar, .f-scroll::-webkit-scrollbar, body::-webkit-scrollbar { width: 10px; height: 10px; }
.f-modal-bd::-webkit-scrollbar-track, .modal-box::-webkit-scrollbar-track, .f-scroll::-webkit-scrollbar-track, body::-webkit-scrollbar-track {
    background: transparent; border-radius: 99px; margin: 4px;
}
.f-modal-bd::-webkit-scrollbar-thumb, .modal-box::-webkit-scrollbar-thumb, .f-scroll::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
    background: var(--f-border-2); border-radius: 99px;
    border: 3px solid transparent; background-clip: padding-box;
}
.f-modal-bd::-webkit-scrollbar-thumb:hover, .modal-box::-webkit-scrollbar-thumb:hover, .f-scroll::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover {
    background: var(--f-text-3); border: 3px solid transparent; background-clip: padding-box;
}

/* ---------- Modal legado (.modal-cfg / .modal-edit / .modal-prof / .modal-seg
   / .modal-sg) Mantidos por compatibilidade, agora alinhados ao Fluent 2 ---------- */
.modal-cfg, .modal-prof, .modal-seg, .modal-sg, .modal-edit {
    position: fixed; inset: 0; z-index: 100;
    display: none; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(36, 36, 36, .45); backdrop-filter: blur(4px);
}
.modal-cfg.open, .modal-prof.open, .modal-seg.open, .modal-sg.open, .modal-edit.open { display: flex; }
.modal-box {
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: var(--f-radius-xl);
    padding: 20px;
    width: 100%; max-width: 480px;
    max-height: calc(100dvh - 32px);   /* respeita a barra/abas do navegador no celular */
    overflow-y: auto;                  /* a propria caixa rola, com a barra estilizada acima */
    overscroll-behavior: contain;
    box-shadow: var(--f-shadow-xl);
    animation: f-pop .22s cubic-bezier(.2, .8, .3, 1);
}

/* ---------- Empty states ---------- */
.f-empty { text-align: center; padding: 42px 20px; }
.f-empty .fi { font-size: 40px; margin-bottom: 12px; display: block; }
.f-empty h4 { font-weight: 800; color: var(--f-text-2); margin-bottom: 4px; }
.f-empty p { font-size: .8rem; color: var(--f-text-3); font-weight: 600; }

/* ---------- Lista / linhas compactas ---------- */
.f-row { display: flex; align-items: center; gap: 10px; }
.f-num { font-variant-numeric: tabular-nums; }

/* ---------- Utilidades Fluent ---------- */
.f-scroll-none::-webkit-scrollbar { display: none; }
.f-scroll-none { scrollbar-width: none; }

@media (max-width: 640px) {
    .f-hero { padding: 14px 14px; }
    .f-hero-tile { width: 40px; height: 40px; font-size: 18px; }
}

/* ============================================================
   RESPONSIVIDADE GLOBAL
   O Tailwind entra via CDN e injeta os utilitários em runtime,
   por isso estas regras usam !important para vencer a ordem
   de cascata e valer em QUALQUER resolução de tela.
   ============================================================ */

/* ---------- Telas pequenas (<= 640px): grids colapsam ---------- */
@media (max-width: 640px) {
    /* 2 colunas -> 1 coluna */
    .grid-cols-2 { grid-template-columns: minmax(0, 1fr) !important; }
    /* 3+ colunas -> 2 colunas (mantém densidade sem espremer) */
    .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-cols-6,
    .grid-cols-7, .grid-cols-8, .grid-cols-9, .grid-cols-10,
    .grid-cols-11, .grid-cols-12 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    /* grades com colunas de tracks (ex.: sm:grid-cols-[1fr_auto]) */
    .sm\:grid-cols-\[1fr_auto\], .sm\:grid-cols-2, .sm\:grid-cols-3, .sm\:grid-cols-4 {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    /* Tabelas: scroll confortável e densa */
    .f-table-w { -webkit-overflow-scrolling: touch; }
    .f-table { font-size: .74rem; }
    .f-table th { padding: 8px 10px; }
    .f-table td { padding: 8px 10px; }

    /* Botões e rótulos podem quebrar em telas estreitas */
    .f-btn { white-space: normal; }
    .f-btn-lg { width: 100%; }

    /* Cards e modais */
    .f-card-hd { flex-wrap: wrap; padding: 12px 14px; }
    .f-card-bd { padding: 14px; }
    .f-stat { flex-wrap: wrap; }
    .f-stat-value { font-size: 1.25rem; }
    .f-sec-title { flex-wrap: wrap; }
    .f-modal { padding: 10px; align-items: flex-start; }
    .f-modal-bd { padding: 16px; }
    .f-modal-ft { flex-wrap: wrap; }
    .f-modal-ft .f-btn { flex: 1 1 auto; }
    .f-empty { padding: 28px 14px; }
    .f-empty .fi { font-size: 32px; }

    /* Título da página não deve estourar */
    .f-hero h1 { font-size: 1.05rem; }
    .f-hero p { font-size: .72rem; }
}

/* ---------- Telas médias (<= 1023px) ---------- */
@media (max-width: 1023px) {
    .f-modal-card { max-width: 100%; }
}

/* ---------- Telas muito estreitas (<= 400px) ---------- */
@media (max-width: 400px) {
    .f-btn { font-size: .74rem; padding: 8px 10px; }
    .f-badge { font-size: .62rem; padding: 3px 8px; }
    .f-table { font-size: .7rem; }
    .f-table th, .f-table td { padding: 7px 8px; }
}

/* ---------- Telas muito largas: evita linhas de texto gigantes ---------- */
@media (min-width: 1600px) {
    .f-container-wide { max-width: 1600px; }
}

/* ============================================================
   PLAYER DE ÁUDIO (RÁDIO WEB)
   Barra fixa no rodapé seguindo o tema Fluent do sistema.
   ============================================================ */
.f-player {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    font-family: var(--f-font);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--f-border);
    box-shadow: 0 -12px 32px -14px rgba(15, 23, 42, .28);
}
.f-player audio { display: none; }
.f-player-inner {
    max-width: 1600px; margin: 0 auto;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 18px;
}

/* Capa da estação */
.f-player-art {
    width: 52px; height: 52px; flex-shrink: 0; padding: 4px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--f-primary), var(--f-accent));
    box-shadow: var(--f-shadow-md);
}
.f-player-art img {
    width: 100%; height: 100%; border-radius: 10px;
    object-fit: contain; background: #fff;
}

/* Nome + status */
.f-player-meta { flex: 1 1 auto; min-width: 0; }
.f-player-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .62rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--f-text-3);
}
.f-player-live {
    width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0;
    background: var(--f-success); box-shadow: 0 0 0 3px var(--f-success-soft);
}
.f-player-live.is-idle { background: var(--f-text-3); box-shadow: 0 0 0 3px #f1f5f9; }
.f-player-live.is-error { background: var(--f-danger); box-shadow: 0 0 0 3px var(--f-danger-soft); }
.f-player-name {
    font-size: .9rem; font-weight: 800; color: var(--f-text);
    letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}

/* Controles */
.f-player-toggle {
    width: 44px; height: 44px; padding: 0; flex-shrink: 0;
    border-radius: 999px; font-size: 18px;
    box-shadow: var(--f-shadow-md);
}
.f-player-vol { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.f-player-vol .f-btn-icon { color: var(--f-text-3); }
.f-range {
    -webkit-appearance: none; appearance: none;
    width: 96px; height: 6px; border-radius: 999px;
    background: var(--f-border); outline: none; cursor: pointer;
}
.f-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 999px;
    background: var(--f-primary); border: 2px solid #fff;
    box-shadow: var(--f-shadow); transition: transform .15s ease;
}
.f-range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.f-range::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 999px;
    background: var(--f-primary); border: 2px solid #fff; box-shadow: var(--f-shadow);
}
.f-range:focus-visible { box-shadow: var(--f-ring); }

@media (max-width: 640px) {
    .f-player-inner { gap: 10px; padding: 10px 12px; }
    .f-player-art { width: 44px; height: 44px; border-radius: 12px; }
    .f-player-vol .f-range { display: none; }
    .f-player-toggle { width: 40px; height: 40px; font-size: 16px; }
    .f-player-name { font-size: .82rem; }
}

/* ---------- Sugestões rápidas de rádio (card da página inicial) ---------- */
.f-radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}
.f-radio-quick {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; text-align: left;
    background: #fff; cursor: pointer;
    border: 1px solid var(--f-border); border-radius: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.f-radio-quick:hover {
    border-color: var(--f-primary);
    box-shadow: var(--f-shadow-md);
    transform: translateY(-1px);
}
.f-radio-quick img {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 9px; object-fit: contain; background: var(--f-primary-soft);
}
.f-radio-quick span {
    flex: 1; min-width: 0;
    font-size: .74rem; font-weight: 800; color: var(--f-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.f-radio-quick i { color: var(--f-primary); font-size: 15px; flex-shrink: 0; }
.f-radio-skeleton {
    height: 52px; border-radius: 12px;
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: f-radio-brilho 1.4s linear infinite;
}
@keyframes f-radio-brilho {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   PADRÃO VISUAL DO INÍCIO (aplicado a todas as telas)
   Academia, Master e Aluno usam o mesmo cabeçalho de página:
   título compacto direto sobre o fundo + ícone em "chip" suave,
   igual à tela Início. Antes cada tela abria com um cartão em
   degradê e ícone grande, diferente do Início.
   (fica no fim do arquivo para valer sobre as regras acima)
   ============================================================ */
.f-hero {
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    padding: 2px 0 0; margin-bottom: 18px; position: relative; overflow: visible;
}
.f-hero > .absolute, .f-hero > .hidden { display: none !important; }      /* bolhas decorativas */
.f-hero h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; color: #0f172a; line-height: 1.25; }
.f-hero p { font-size: .75rem; font-weight: 600; color: #64748b; margin-top: 2px; }
.f-hero .f-hero-tile:not([class*="bg-gradient"]) {
    width: 38px; height: 38px; border-radius: 11px; font-size: 18px;
    background: var(--f-primary-soft); color: var(--f-primary); box-shadow: none;
}
@media (max-width: 640px) {
    .f-hero { padding: 0; margin-bottom: 14px; }
    .f-hero h1 { font-size: 1.02rem; }
}

/* Títulos de seção (os mesmos do Início): ícone em chip + título */
.f-secao, .ip-secao { display: flex; align-items: center; gap: .6rem; margin: 2rem 0 .9rem; flex-wrap: wrap; }
.f-secao h2, .ip-secao h2 { font-size: 15px; font-weight: 900; color: #0f172a; }
.f-secao > span:last-child:not(.f-secao-ic):not(.ip-secao-ic),
.ip-secao > span:last-child:not(.ip-secao-ic):not(.f-secao-ic) { font-size: 11px; font-weight: 700; color: #94a3b8; }
.f-secao-ic, .ip-secao-ic {
    width: 28px; height: 28px; border-radius: 9px; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--f-primary-soft); color: var(--f-primary);
}

/* =========================================================================
   LOGIN DIVIDIDO (academia, aluno, master) — lado da marca + formulário.
   No celular o lado da marca vira uma faixa compacta no topo.
   ========================================================================= */
.f-login.f-login-dividido { padding: 0; display: grid; grid-template-columns: 1fr; align-items: stretch; background: var(--f-surface-2);
    /* sai do container central do base.html: a tela de login ocupa a janela inteira */
    width: 100vw; margin-left: calc(50% - 50vw); }
.f-login-lado {
    position: relative; overflow: hidden; color: #fff;
    padding: 28px 24px 34px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
}
.f-login[data-painel="academia"] .f-login-lado { background: linear-gradient(150deg, #1e3a8a 0%, #2563eb 55%, #38bdf8 120%); }
.f-login[data-painel="master"]  .f-login-lado { background: linear-gradient(150deg, #0f172a 0%, #334155 60%, #64748b 130%); }
.f-login[data-painel="aluno"]   .f-login-lado { background: linear-gradient(150deg, #134e4a 0%, #0d9488 55%, #34d399 125%); }
.f-login-lado::before, .f-login-lado::after {
    content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none;
}
.f-login-lado::before { width: 420px; height: 420px; right: -160px; top: -160px; }
.f-login-lado::after  { width: 300px; height: 300px; left: -120px; bottom: -140px; }
.f-login-lado > * { position: relative; z-index: 1; }
.f-login-lado-marca { display: flex; align-items: center; gap: 12px; }
.f-login-lado-marca .ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.f-login-lado-marca b { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.f-login-lado-marca small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.f-login-lado h2 { font-size: 1.5rem; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; max-width: 24ch; }
.f-login-lado p.lead { font-size: .88rem; opacity: .88; margin-top: 8px; max-width: 42ch; line-height: 1.5; }
.f-login-lado ul { display: none; list-style: none; padding: 0; margin: 0; }
.f-login-lado li { display: flex; align-items: flex-start; gap: 10px; font-size: .85rem; font-weight: 600; margin-top: 12px; opacity: .95; }
.f-login-lado li i { width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.16);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.f-login-lado .rodape-lado { font-size: .72rem; font-weight: 600; opacity: .7; display: none; }
.f-login-dividido .f-login-caixa { margin: -18px auto 28px; padding: 0 16px; max-width: 440px; }
.f-login-dividido .f-login-marca { display: none; }
.f-login-dividido .f-login-card { box-shadow: 0 18px 50px rgba(15, 23, 42, .14); }
.f-login-dividido .f-login-corpo { padding: 26px 26px 24px; }
.f-login-dividido .f-login-titulo { font-size: 1.35rem; font-weight: 800; }
.f-login-caps { display: none; margin-top: 6px; font-size: .72rem; font-weight: 700; color: #b45309; }
.f-login-caps.on { display: flex; align-items: center; gap: 5px; }
.f-btn.carregando { opacity: .75; pointer-events: none; }
.f-btn.carregando i { animation: f-girar .8s linear infinite; }
@keyframes f-girar { to { transform: rotate(360deg); } }
@media (min-width: 1024px) {
    .f-login.f-login-dividido { grid-template-columns: minmax(420px, 46%) 1fr; }
    .f-login-lado { padding: 48px 52px; min-height: 100dvh; }
    .f-login-lado h2 { font-size: 2.15rem; }
    .f-login-lado ul, .f-login-lado .rodape-lado { display: block; }
    .f-login-dividido .f-login-caixa { margin: auto; padding: 0; align-self: center; }
}
html:has(.f-login-dividido), html:has(.f-login-dividido) body { overflow-x: hidden; }
