/* assets/css/style.css */
:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.3); /* Brilho azul */
    --radius: 24px; /* Bordas bem arredondadas estilo iOS/Fintech */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient); /* Fundo mais moderno */
    color: var(--text-color); /* Vem do PHP */
    line-height: 1.6;
}

/* Header */
header {
    background-color: var(--header-bg); /* Vem do PHP */
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1.5rem 0;
    backdrop-filter: blur(10px); /* Efeito vidro */
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.btn-action {
    background-color: var(--primary-color);
    background-image: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-action::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-action:hover::after {
    left: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #111827;
}

.hero p {
    font-size: 1.25rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Cards Grid */
.investments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0 5rem;
}

.card {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 10px -2px rgba(0, 0, 0, 0.02);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(59, 130, 246, 0.15), 0 10px 20px -5px rgba(0, 0, 0, 0.05);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f3f4f6;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.stat-label {
    color: #9ca3af;
    display: block;
    font-size: 0.8rem;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
}

.btn-card {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    background-color: #eff6ff;
    color: var(--primary-color);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-card:hover {
    background-color: #dbeafe;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 3rem 0;
    text-align: center;
    color: #6b7280;
}

/* Auth Pages (Login/Register) */
.auth-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-color: #f9fafb;
}

.auth-box {
    background: #fff;
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid #e5e7eb;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -2px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-block {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Input com Ícone (Senha) */
.input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    background: none;
    border: none;
    padding: 0;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* Grupo de Telefone (DDI + Número) */
.phone-group {
    display: flex;
    gap: 10px;
}

.phone-ddi {
    width: 90px;
    flex-shrink: 0;
}

/* Lista de Requisitos de Senha */
.password-requirements {
    list-style: none;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.req-item {
    margin-bottom: 2px;
    transition: color 0.2s;
}

.req-item.valid { color: #16a34a; } /* Verde */
.req-item.invalid { color: #dc2626; } /* Vermelho */

/* --- DASHBOARD LAYOUT --- */
.d-flex { display: flex; }
.h-100vh { min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #fff;
    border-right: 1px solid rgba(229, 231, 235, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-menu {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.menu-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    padding-left: 0.75rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: #f0f9ff; /* Azul bem clarinho */
    color: var(--primary-color);
}

.nav-link svg {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

/* Main Content Area */
.main-content {
    margin-left: 260px; /* Largura da sidebar */
    width: calc(100% - 260px);
    background: transparent; /* Usa o gradiente do body */
    min-height: 100vh;
    padding: 2rem;
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #374151;
    margin-bottom: 1rem;
}

.mobile-header {
    display: none;
    position: relative; /* Changed from fixed to relative so it scrolls */
    width: 100%;
    background: transparent;
    z-index: 1;
    padding: 0 0 1rem 0;
    box-shadow: none;
    justify-content: flex-start;
    height: auto;
    margin-bottom: 0.5rem;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Esconde a sidebar */
    }
    
    .sidebar.open {
        transform: translateX(0); /* Mostra a sidebar */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem; /* Reduzido de 2rem para aproximar do canto */
    }
    
    .mobile-header {
        display: flex;
    }

    .mobile-logo img {
        height: 45px !important; /* Força o logo a ficar menor */
    }

    .mobile-logo span {
        font-size: 1.2rem !important;
    }
    
    /* Overlay escuro quando menu abre no mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 900;
    }
    .sidebar-overlay.active { display: block; }
}

/* --- MODAL (POPUP) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
}

.modal-body {
    padding: 1.5rem;
}

/* Calculadora no Modal */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.calc-item label {
    font-size: 0.75rem;
    color: #6b7280;
    display: block;
    margin-bottom: 2px;
}

.calc-item strong {
    font-size: 1rem;
    color: #111827;
}

/* --- INFO GRID (NOVO MODAL) --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.2s;
}

.info-item:hover { border-color: var(--primary-color); background-color: #eff6ff; }
.info-item.primary .info-icon { color: var(--primary-color); }
.info-item.gray .info-icon { color: #9ca3af; }
.info-item.primary .info-value { color: var(--primary-color); }

.info-icon { width: 22px; height: 22px; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.info-label { font-size: 0.7rem; color: #6b7280; font-weight: 500; margin-top: 2px; }
.info-value { font-size: 0.95rem; font-weight: 700; color: #1f2937; }

/* --- MOBILE BOTTOM NAV --- */
.mobile-bottom-nav {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9); /* Transparente */
    backdrop-filter: blur(12px); /* Efeito vidro */
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 1000;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
}

.mobile-nav-list {
    display: flex;
    justify-content: space-around;
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.mobile-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.65rem;
    transition: color 0.2s;
}

.mobile-nav-item a.active,
.mobile-nav-item a:hover {
    color: var(--primary-color);
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    /* Add padding to the body to prevent content from being hidden by the nav bar */
    body.dashboard-body {
        padding-top: 0; /* Removed padding since header is not fixed anymore */
        padding-bottom: 70px;
    }
}

/* --- PAGE HEADERS (Títulos das Páginas) --- */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.05rem;
    color: #6b7280;
}

.highlight-name {
    color: var(--primary-color);
    font-weight: 700;
}

/* --- PROFILE TABS --- */
.profile-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.profile-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.profile-tab:hover { color: var(--primary-color); }
.profile-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
