/* css/style.css */
:root {
    --bg-dark: #07070a;
    --bg-card: #12121a;
    --bg-nav: rgba(15, 15, 21, 0.95);
    --primary: #7c3aed; 
    --primary-hover: #6d28d9;
    --text-main: #f0f0f5;
    --text-muted: #8e8e9f;
    --danger: #ff4b4b;
    --success: #00e676;
    --border: rgba(255, 255, 255, 0.08);
    --radius-premium: 16px;
}

/* BUG FIX: Reset global e performance */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    line-height: 1.6; 
    padding-bottom: 100px; 
    overflow-x: hidden;
    min-height: 100vh;
}

a { text-decoration: none; color: var(--primary); transition: 0.3s; }

/* Layout SPA */
.app-container { 
    width: 100%;
    max-width: 500px; 
    margin: 0 auto; 
    padding: 20px; 
}

.page-section { display: none; }
.page-section.active { 
    display: block; 
    animation: fadeInSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
}

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

/* Cabeçalho */
.header-brand { 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    gap: 10px; 
    margin-bottom: 40px; 
    padding-top: 10px; 
}
.header-logo { max-height: 60px; width: auto; filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.3)); }

h1, h2, h3 { color: #fff; margin-bottom: 15px; font-weight: 700; letter-spacing: -0.5px; }

/* Menu Inferior Glassmorphism */
.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: var(--bg-nav); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border); 
    display: flex; 
    justify-content: space-around; 
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); 
    z-index: 1000; 
}

.nav-item { 
    background: none; 
    border: none; 
    color: var(--text-muted); 
    font-size: 0.7rem; 
    font-weight: 600; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px; 
    cursor: pointer; 
    transition: 0.3s; 
    flex: 1; 
}

.nav-item svg { width: 22px; height: 22px; fill: currentColor; transition: 0.3s; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { transform: translateY(-3px); filter: drop-shadow(0 0 5px var(--primary)); }

/* Cards & Formulários */
.card { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    border-radius: var(--radius-premium); 
    padding: 24px; 
    margin-bottom: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.input-group { margin-bottom: 20px; width: 100%; }
.input-group label { display: block; margin-bottom: 10px; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

/* BUG FIX: Removido qualquer fundo branco e corrigido autofill do navegador */
input { 
    width: 100%; 
    padding: 16px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    background: #000 !important; /* Garantido fundo preto */
    color: #fff !important; 
    font-size: 16px; 
    outline: none; 
    transition: 0.3s;
}

/* BUG FIX: Impede que o navegador mude a cor do input ao preencher automaticamente */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0px 1000px #000 inset;
    transition: background-color 5000s ease-in-out 0s;
}

input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1); }

/* BUG FIX: Estilo para inputs bloqueados (Aguardando validação) */
input[readonly] {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
    color: rgba(255, 255, 255, 0.2) !important;
    cursor: not-allowed;
}

/* BUG FIX: Layout de linha para CPF + Botão */
.input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Botões */
.btn { 
    width: 100%; 
    padding: 16px; 
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff; 
    border: none; 
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 1rem; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.btn:active { transform: scale(0.96); opacity: 0.9; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn:disabled { background: #222 !important; opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* Carteira Premium */
.balance-box { 
    background: linear-gradient(180deg, #160f24 0%, #07070a 100%); 
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    text-align: center; 
    padding: 35px 25px; 
    border-radius: var(--radius-premium);
}
.balance-value { font-size: 2.8rem; font-weight: 800; color: #fff; margin: 10px 0; letter-spacing: -1px; }

/* Modais Drawer Mobile */
.modal { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.9); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000; 
    justify-content: center; 
    align-items: flex-end; 
}

.modal.active { display: flex; }

.modal-content { 
    background: var(--bg-card); 
    width: 100%; 
    max-width: 450px; 
    border-radius: 24px 24px 0 0; 
    padding: 30px; 
    position: relative; 
    border: 1px solid var(--border);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-close { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    width: 30px; 
    height: 30px; 
    background: rgba(255,255,255,0.05); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--text-muted); 
    cursor: pointer; 
}

/* Planos Premium (Alinhamento Automático) */
.plan-grid { 
    display: grid; 
    /* Isso cria uma grade inteligente: centraliza os planos e ajusta as colunas
       automaticamente dependendo do tamanho da tela do celular/PC */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    gap: 15px; 
    justify-content: center;
    padding-bottom: 20px;
}

/* Engloba tanto o card antigo quanto o novo Elite Card */
.plan-card, .elite-card { 
    background: linear-gradient(180deg, rgba(20, 12, 35, 0.6) 0%, rgba(10, 10, 15, 0.9) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 24px;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    text-align: left; /* Alinha o texto à esquerda para o visual gringo */
}

.plan-card:hover, .plan-card:active,
.elite-card:hover, .elite-card:active { 
    border-color: var(--primary); 
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.15); 
}

/* Elementos internos do Card (Preço, Badge e Rendimento) */
.plan-header { display: flex; justify-content: space-between; align-items: center; }
.plan-name { color: #fff; font-size: 1.1rem; font-weight: 800; text-transform: uppercase; }
.plan-badge { background: rgba(124, 58, 237, 0.15); color: #a78bfa; font-size: 0.65rem; font-weight: 800; padding: 4px 8px; border-radius: 8px; }

.plan-price-wrapper { display: flex; align-items: baseline; gap: 4px; }
.plan-price-wrapper .currency { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
.plan-price-wrapper .amount { color: #fff; font-size: 2rem; font-weight: 800; letter-spacing: -1px; }

.plan-yield {
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.2);
    color: var(--success);
    padding: 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

/* Toasts */
#toast-container { 
    position: fixed; 
    top: env(safe-area-inset-top, 20px); 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 9999; 
    width: 90%; 
    max-width: 350px; 
    pointer-events: none; 
}

.toast { 
    background: #1c1c24; 
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary); 
    color: #fff; 
    padding: 16px 20px; 
    border-radius: 12px; 
    font-size: 0.9rem; 
    font-weight: 600; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    margin-bottom: 10px;
    display: flex; 
    align-items: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
