/* ============================================================
   OSA BANK — DESIGN SYSTEM v2.0
   ============================================================ */
:root {
    --bg-dark:       #0d0d10;
    --bg-surface:    #16161a;
    --card-dark:     #1e1e24;
    --card-hover:    #252530;
    --primary:       #8257e5;
    --primary-light: #a78bfa;
    --primary-glow:  rgba(130, 87, 229, 0.25);
    --secondary:     #d946ef;
    --success:       #22d3a0;
    --success-bg:    rgba(34, 211, 160, 0.12);
    --danger:        #f43f5e;
    --danger-bg:     rgba(244, 63, 94, 0.12);
    --warning:       #f59e0b;
    --warning-bg:    rgba(245, 158, 11, 0.12);
    --text:          #e2e8f0;
    --text-muted:    #94a3b8;
    --text-dim:      #64748b;
    --border:        #2a2a35;
    --border-light:  #333340;
    --input-bg:      #0d0d10;
    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     20px;
    --radius-xl:     28px;
    --shadow:        0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow:   0 0 40px rgba(130, 87, 229, 0.15);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: 'Poppins', 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background-image:
        radial-gradient(ellipse at 80% 0%, rgba(130,87,229,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 100%, rgba(217,70,239,0.07) 0%, transparent 50%);
}
img { max-width: 100%; height: auto; }
a { color: var(--primary-light); text-decoration: none; }

/* ── APP CONTAINER ── */
.app-container {
    width: 100%;
    max-width: 430px;
    background-color: var(--bg-surface);
    min-height: 100vh;
    padding: 24px 20px 40px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}
@media (min-width: 480px) {
    body { align-items: center; padding: 20px 0; }
    .app-container {
        min-height: auto;
        max-height: 92vh;
        border-radius: var(--radius-xl);
        border: 1px solid var(--border-light);
        box-shadow: var(--shadow), var(--shadow-glow);
    }
}

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
    width: 90%;
    max-width: 380px;
}
.toast {
    background: var(--card-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    width: 100%;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    pointer-events: all;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--primary); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast-icon { font-size: 1.2rem; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(20px) scale(0.95); }
}

/* ── LOGO & SPLASH ── */
.logo-area {
    text-align: center;
    margin: 50px 0 40px;
    animation: fadeUp 0.8s ease;
}
.logo-area h1 {
    font-size: 2.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}
.logo-area p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.logo-grande {
    width: 110px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
    filter: drop-shadow(0 0 20px rgba(130, 87, 229, 0.5));
    animation: flutuar 3s ease-in-out infinite;
}
.logo-pequena {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(130, 87, 229, 0.5));
}

/* ── INPUTS ── */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}
.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-fixo { opacity: 0.45; cursor: not-allowed; }

/* ── BOTÕES ── */
.btn-entrar {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #6b42c8);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}
.btn-entrar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.08);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn-entrar:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(130,87,229,0.4); }
.btn-entrar:hover::after { opacity: 1; }
.btn-entrar:active { transform: scale(0.98); }
.btn-entrar:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 8px;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-light); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #be123c) !important;
    box-shadow: none;
}
.btn-danger:hover { box-shadow: 0 8px 24px rgba(244,63,94,0.35) !important; }

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669) !important;
}
.btn-success:hover { box-shadow: 0 8px 24px rgba(34,211,160,0.3) !important; }

/* ── HEADER ── */
.header-banco {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.header-banco h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.perfil-icon {
    background: var(--card-dark);
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
}
.perfil-icon:hover { border-color: var(--primary); }
.perfil-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── CARD SALDO ── */
.card-saldo {
    background: linear-gradient(135deg, #6b42c8 0%, #8257e5 50%, #d946ef 100%);
    color: white;
    padding: 24px 22px;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(130, 87, 229, 0.35);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.card-saldo::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 65%);
    pointer-events: none;
}
.card-saldo::after {
    content: '';
    position: absolute;
    bottom: -50%; left: -10%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(0,0,0,0.15), transparent 65%);
    pointer-events: none;
}
.card-saldo p { font-size: 0.8rem; opacity: 0.85; margin-bottom: 4px; }
.card-saldo .valor { font-size: 2.6rem; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }
.card-saldo .valor small { font-size: 1.1rem; font-weight: 500; }
.card-saldo .turma-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

/* ── MENU AÇÕES ── */
.menu-acoes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.menu-acoes button {
    height: 90px;
    background: var(--card-dark);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.menu-acoes button:hover {
    border-color: var(--primary);
    background: var(--card-hover);
    transform: translateY(-2px);
}
.menu-acoes .icon { font-size: 1.5rem; }

/* ── CARDS GENÉRICOS ── */
.card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--border-light); }
.card-clickable:hover { border-color: var(--primary); transform: translateY(-1px); cursor: pointer; }

/* ── VIBE / MÚSICA ── */
.vibe-banner {
    background: linear-gradient(135deg, var(--bg-dark), var(--card-dark));
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    cursor: pointer;
    transition: 0.2s;
}
.vibe-banner:hover { border-color: var(--primary); }

/* ── EXTRATO ── */
.lista-extrato { display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }
.item-transacao {
    background: var(--card-dark);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}
.item-transacao:hover { border-color: var(--border-light); transform: translateX(3px); }
.info-transacao h4 { font-size: 0.9rem; font-weight: 600; }
.info-transacao p { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.valor-transacao { font-weight: 700; font-size: 1rem; }
.entrada { color: var(--success); }
.saida   { color: var(--danger); }

/* ── PERFIL ── */
.perfil-area { display: flex; flex-direction: column; align-items: center; margin: 10px 0 24px; }
.avatar-wrapper {
    position: relative;
    width: 110px; height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 0 24px rgba(130,87,229,0.35);
    transition: 0.2s;
}
.avatar-wrapper:hover { transform: scale(1.05); }
.avatar-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.overlay-camera {
    position: absolute; bottom: 0; width: 100%; height: 36px;
    background: rgba(0,0,0,0.65);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

/* ── PAINEL/TABELA ── */
.tabela-container {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: var(--card-hover); }
th { color: var(--primary-light); font-weight: 600; padding: 12px 14px; text-align: left; font-size: 0.8rem; letter-spacing: 0.3px; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.linha-bloqueada { background: var(--danger-bg); opacity: 0.75; }

/* ── BOTÕES DE TABELA ── */
.btn-block {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    transition: 0.2s;
}
.btn-ativo   { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.btn-bloqueado { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.btn-ativo:hover   { background: var(--danger); color: white; }
.btn-bloqueado:hover { background: var(--success); color: white; }

/* ── BADGES / CONQUISTAS ── */
.lista-conquistas { display: flex; flex-direction: column; gap: 12px; }
.conquista-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--card-hover);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.conquista-item.desbloqueada { border-color: var(--primary); background: var(--primary-glow); }
.emoji-badge { font-size: 1.8rem; width: 44px; text-align: center; }
.conquista-item strong { color: var(--primary-light); font-size: 0.88rem; }
.conquista-item p { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

/* ── MODAL ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 20px;
}
.modal-content {
    background: var(--card-dark);
    padding: 28px 24px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 360px;
    text-align: center;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    animation: fadeUp 0.25s ease;
}
.modal-content h3 { font-size: 1.15rem; margin-bottom: 8px; }
.modal-content p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 20px; }
.btn-fechar {
    padding: 10px 20px;
    background: var(--card-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    transition: 0.2s;
}
.btn-fechar:hover { border-color: var(--primary); color: var(--text); }

/* ── ADMIN DASHBOARD CARDS ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: 0.2s;
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.stat-card .stat-icon { font-size: 1.4rem; margin-bottom: 8px; }
.stat-card.primary { border-color: rgba(130,87,229,0.4); background: rgba(130,87,229,0.08); }
.stat-card.success { border-color: rgba(34,211,160,0.4); background: rgba(34,211,160,0.06); }
.stat-card.danger  { border-color: rgba(244,63,94,0.4); background: rgba(244,63,94,0.06); }
.stat-card.warning { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.06); }

/* ── ADMIN NAV MENU ── */
.admin-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.admin-nav-btn {
    background: var(--card-dark);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.admin-nav-btn .icon { font-size: 1.5rem; }
.admin-nav-btn:hover { border-color: var(--primary); background: var(--card-hover); color: var(--primary-light); }
.admin-nav-btn.active { border-color: var(--primary); background: var(--primary-glow); color: var(--primary-light); }

/* ── LOG ATIVIDADES ── */
.log-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.log-item:last-child { border-bottom: none; }
.log-tipo {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}
.log-tipo.LOGIN    { background: rgba(130,87,229,0.2); color: var(--primary-light); }
.log-tipo.TRANSACAO { background: rgba(34,211,160,0.2); color: var(--success); }
.log-tipo.BLOQUEIO { background: rgba(244,63,94,0.2); color: var(--danger); }
.log-tipo.RENDIMENTO { background: rgba(245,158,11,0.2); color: var(--warning); }
.log-tipo.ADMIN_CRIADO { background: rgba(217,70,239,0.2); color: var(--secondary); }
.log-tipo.SENHA { background: rgba(100,116,139,0.2); color: var(--text-muted); }
.log-tipo.VOTO { background: rgba(34,211,160,0.15); color: var(--success); }
.log-info .log-desc { font-size: 0.83rem; font-weight: 500; color: var(--text); }
.log-info .log-data { font-size: 0.73rem; color: var(--text-dim); margin-top: 2px; }

/* ── RANKING ── */
.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: var(--card-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: 0.2s;
}
.ranking-item:hover { border-color: var(--border-light); }
.ranking-item.top1 { border-color: #f59e0b; background: rgba(245,158,11,0.07); }
.ranking-item.top2 { border-color: #94a3b8; background: rgba(148,163,184,0.05); }
.ranking-item.top3 { border-color: #cd7c3a; background: rgba(205,124,58,0.07); }
.ranking-pos { font-size: 1rem; font-weight: 800; width: 28px; text-align: center; color: var(--text-dim); }
.ranking-info { flex: 1; }
.ranking-info .nome { font-size: 0.88rem; font-weight: 600; }
.ranking-info .turma { font-size: 0.75rem; color: var(--text-muted); }
.ranking-saldo { font-weight: 800; font-size: 0.95rem; color: var(--success); }

/* ── BADGE TURMA ── */
.badge-turma {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--primary-glow);
    color: var(--primary-light);
    border: 1px solid rgba(130,87,229,0.3);
}

/* ── FILTROS ── */
.filtros-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filtros-row .input-group { margin-bottom: 0; flex: 1; min-width: 120px; }
.filtros-row select, .filtros-row input {
    padding: 10px 12px;
    font-size: 0.83rem;
}

/* ── SECTION TITLES ── */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    margin-top: 4px;
}

/* ── RODAPÉ ── */
.footer-jokentek {
    text-align: center;
    margin-top: 32px;
    padding-bottom: 10px;
    font-size: 0.72rem;
    color: var(--text-dim);
}
.footer-jokentek a { color: var(--primary); font-weight: 600; transition: 0.2s; }
.footer-jokentek a:hover { color: var(--success); }

/* ── QR CODE ── */
#reader { border: 2px solid var(--primary); border-radius: var(--radius-md); box-shadow: 0 0 20px var(--primary-glow); }

/* ── ANIMAÇÕES ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes flutuar {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ── PRINT (CARTÕES) ── */
@media print {
    @page { margin: 10mm; }
    body { background: white; -webkit-print-color-adjust: exact; }
    .no-print { display: none !important; }
    .grid-cartoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ── UTILITÁRIOS ── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary-light); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.w-full { width: 100%; }
.loading-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
