@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-pure: #f5f7fa; /* Fundo Cinza/Gelo Muito Claro */
    --text-primary: #1a1a1a; /* Quase Preto (Melhor Leitura) */
    --text-secondary: #5a5a5a; /* Cinza Metálico Escuro */
    
    /* Liquid Glass Variables (Tema Claro) */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-highlight: rgba(255, 255, 255, 1); /* Reflexo forte no branco */
    --glass-shadow: rgba(0, 0, 0, 0.05); /* Sombra difusa no lugar do fundo preto */
    
    /* Accents sutis */
    --accent-glow: rgba(13, 252, 121, 0.15);
    --warning-color: #ff3b30;
    --neon-primary: #00c05a; /* Verde um tom mais escuro para contraste texto */
    --neon-solid: #0dfc79; /* Verde Neon puro para botões */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-pure);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 480px; /* Mais estreito para manter a elegância em telas maiores */
    margin: 0 auto;
    position: relative;
}

/* Ambient Glow para o vidro distorcer */
.ambient-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}
.glow-top {
    top: -50px;
    left: -50px;
    background: rgba(13, 252, 121, 0.15); /* Verde neon sutil */
}
.glow-bottom {
    bottom: 100px;
    right: -50px;
    background: rgba(13, 252, 121, 0.25); /* Verde neon mais forte */
}

/* Base do Liquid Glass */
.glass-header, .glass-card, .glass-btn, .glass-nav-bottom {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    /* O truque do luxo no branco: borda fina superior branca e sombra espalhada embaixo */
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 8px 32px var(--glass-shadow);
    z-index: 10;
    position: relative;
}

/* Header Compacto */
.glass-header {
    padding: 16px 20px;
    margin: 12px 16px 0 16px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-greeting p { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px;}
.user-greeting h1 { font-size: 1.1rem; font-weight: 500; margin-top: 2px;}

.premium-badge {
    background: rgba(13, 252, 121, 0.15);
    border: 1px solid rgba(13, 252, 121, 0.5);
    color: var(--neon-primary);
    box-shadow: 0 0 10px rgba(13, 252, 121, 0.3);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Main Content */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px 100px 16px;
}

/* Dashboard Cards */
.dashboard-cards { display: flex; flex-direction: column; gap: 12px; }

.balance-card { padding: 28px 20px; border-radius: 20px; text-align: left; }
.balance-card h3 { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; font-weight: 400;}
.balance-card h2 { font-size: 2rem; font-weight: 600; letter-spacing: -1px; }
.currency { font-size: 1rem; color: var(--neon-primary); font-weight: 600; vertical-align: super; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-item { padding: 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 1.4rem; font-weight: 400; }
.stat-value.warning { color: var(--warning-color); }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); }

/* Botão Elite (Fino e Discreto) */
.action-section { margin-top: 32px; }
.glass-btn {
    width: 100%;
    padding: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.8); /* Fundo claro para o botão não-primário */
}
.glass-btn:active { background: rgba(220, 220, 220, 0.8); transform: scale(0.98); }

/* Bottom Nav Fina */
.glass-nav-bottom {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px); /* Ligeiramente mais amplo para os textos caberem */
    max-width: 440px;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-radius: 24px;
}
.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px; /* Espaço entre ícone e texto */
}
.nav-item i {
    font-size: 1.1rem; 
}
.nav-item span {
    font-size: 0.65rem;
    font-weight: 500;
}
.nav-item.active { 
    color: var(--neon-primary); 
    /* Sem text shadow no branco */
}
/* ========================================== */
/* ESTILOS DE AUTENTICAÇÃO & CONTROLE DE TELAS*/
/* ========================================== */

.hidden { display: none !important; }
.screen-hidden { display: none !important; }
.screen-active { display: block; animation: fadeIn 0.3s ease; }

/* Ocupa a tela toda para fazer a troca perfeita */
.screen-section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
}

/* Auth Layout */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 24px 16px;
    z-index: 10;
}

.auth-header { text-align: center; margin-bottom: 40px; }
.auth-header h1 { font-size: 1.4rem; font-weight: 300; letter-spacing: 1px; }
.auth-header p { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; text-transform: uppercase; letter-spacing: 1px;}

.form-group { margin-bottom: 16px; }
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.5); /* Translúcido no claro */
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.02); /* Sombra interna super sutil */
}
.form-input:focus { 
    border-color: var(--neon-primary); 
    background: rgba(13, 252, 121, 0.05);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2), 0 0 12px rgba(13, 252, 121, 0.2);
}
.form-input::placeholder { color: var(--text-secondary); }

.toggle-auth {
    text-align: center;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.toggle-auth span { 
    color: var(--text-primary); 
    cursor: pointer; 
    font-weight: 500; 
    margin-left: 4px;
    transition: text-shadow 0.2s;
}
.toggle-auth span:hover, #btnForgotPassword:hover { 
    color: var(--text-primary);
    text-decoration: underline !important;
}

/* Ajuste no botão primário para o Auth e forms */
.primary-btn {
    background: var(--neon-solid);
    border: 1px solid var(--neon-primary);
    color: #000000; /* Texto do botão primário sempre preto para contraste */
    margin-top: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(13, 252, 121, 0.3);
}
.primary-btn:hover {
    background: #00e565;
    box-shadow: 0 6px 20px rgba(13, 252, 121, 0.5);
}

/* Botão Logout sutil no header */
.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}
.logout-btn:hover { color: var(--warning-color); }

/* ========================================== */
/* ESTILOS WIZARD CADASTRO                    */
/* ========================================== */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.step-actions .btn-prev {
    width: auto;
    padding: 14px 20px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.step-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.step-indicator .dot.active {
    background: var(--neon-primary);
    box-shadow: 0 0 12px rgba(13, 252, 121, 0.8);
    transform: scale(1.3);
}
/* ========================================== */
/* LISTA DE CLIENTES                          */
/* ========================================== */

/* Lista de clientes (Cards) */
.client-card {
    display: flex;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border); 
    box-shadow: 0 4px 15px var(--glass-shadow);
    transition: all 0.3s ease;
}

.client-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.8);
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 252, 121, 0.15);
    color: var(--neon-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-right: 16px;
    box-shadow: none; /* Sem shadow interno no fundo claro para não ficar sujo */
}

.client-info {
    flex: 1;
    min-width: 0; /* Previne overflow de nomes grandes */
}

.client-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.client-loans-badge {
    background: rgba(13, 252, 121, 0.1);
    color: var(--neon-primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid rgba(13, 252, 121, 0.3);
    margin-right: 12px;
}

.client-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.client-actions button {
    background: rgba(255, 255, 255, 0.4);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.client-actions button:hover {
    background: var(--neon-primary);
    color: #fff;
    transform: scale(1.1);
}

/* ========================================== */
/* STATUS EMPRESTIMOS / DASHBOARD             */
/* ========================================== */

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); border-color: rgba(220, 53, 69, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); border-color: rgba(220, 53, 69, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); border-color: rgba(220, 53, 69, 0.5); }
}

.card-vencido {
    animation: pulse-red 2s infinite;
    border-left: 4px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.05) !important;
}

.btn-pago {
    background: rgba(13, 252, 121, 0.1);
    color: #00c05a;
    border: 1px solid rgba(13, 252, 121, 0.5);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pago:hover {
    background: var(--neon-primary);
    color: #000;
}

/* ========================================== */
/* FILTROS E PAYMENT CARDS PREMIUM            */
/* ========================================== */

.client-filters::-webkit-scrollbar { display: none; }
.filter-badge {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.filter-badge.active {
    background: var(--neon-primary);
    color: #000;
    border-color: var(--neon-primary);
    box-shadow: 0 4px 10px rgba(13, 252, 121, 0.3);
}

.payment-card-premium {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,255,255,0.5));
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.payment-card-premium::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--neon-primary);
}
.payment-card-premium.vencido::before {
    background: #dc3545;
}
.payment-card-premium.vencido {
    animation: pulse-red 2s infinite;
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(220,53,69,0.05));
    border-color: rgba(220,53,69,0.2);
}

/* Utility Classes for Screen Management */
.screen-hidden {
    display: none !important;
}


/* Support Modal (Overlay) */
.support-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.support-overlay.open {
    display: flex;
}

.support-modal {
    background: white;
    border-radius: 32px;
    width: 100%;
    max-width: 360px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.support-modal-header {
    margin-bottom: 24px;
}

.support-modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(0, 192, 90, 0.1);
    color: var(--neon-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.support-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.support-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.support-btn:hover {
    background: #f1f5f9;
    border-color: var(--neon-primary);
    transform: translateY(-2px);
}

.support-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.support-close-btn {
    margin-top: 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.support-fab-trigger {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 2000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--neon-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 192, 90, 0.3);
    transition: all 0.3s;
}

.screen-active {
    display: block !important;
}

.hidden {
    display: none !important;
}