:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light-gray: #e2e8f0;
    --lighter-gray: #f1f5f9;
    --white: #ffffff;
    --bg: #f8fafc;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--light-gray);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Main */
.main {
    flex: 1;
    padding: 30px 0 60px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 50px 0 40px;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero p {
    font-size: 1.05rem;
    color: var(--gray);
    max-width: 550px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 16px;
    border: 1px solid var(--light-gray);
}

.card-header {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--lighter-gray);
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark-2);
    font-size: 0.88rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--white);
    color: var(--dark);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-light);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--gray);
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Bandeiras Grid */
.bandeiras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    min-height: 60px;
    padding: 8px;
    background: var(--lighter-gray);
    border-radius: var(--radius);
}

.bandeira-card {
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.bandeira-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bandeira-card.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.bandeira-card.selected .nome {
    color: var(--white);
}

.bandeira-card.selected small {
    color: rgba(255,255,255,0.85);
}

.bandeira-card .nome {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.bandeira-card small {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Result Card */
.resultado-simulacao {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-top: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.resultado-simulacao h3 {
    font-size: 1.2rem;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 700;
}

.resultado-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.resultado-item {
    text-align: center;
    padding: 16px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.06);
}

.resultado-item .label {
    font-size: 0.78rem;
    opacity: 0.7;
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.resultado-item .value {
    font-size: 1.3rem;
    font-weight: 700;
}

.resultado-item.destaque {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

.resultado-item.destaque .value {
    color: #fbbf24;
    font-size: 1.6rem;
}

/* Botoes de ação */
.botoes-acao {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Alertas */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Admin */
.admin-header {
    background: var(--dark);
    color: var(--white);
    padding: 0;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.admin-nav {
    display: flex;
    gap: 4px;
}

.admin-nav a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.6;
    transition: all 0.2s;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}

.admin-nav a:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.admin-nav a.active {
    opacity: 1;
    background: var(--primary);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--lighter-gray);
    font-size: 0.88rem;
}

table th {
    background: var(--lighter-gray);
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

table tr:hover {
    background: var(--lighter-gray);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-simulado { background: #e2e8f0; color: #475569; }
.badge-interesse { background: #fef3c7; color: #92400e; }
.badge-em_andamento { background: #dbeafe; color: #1e40af; }
.badge-aprovado { background: #d1fae5; color: #065f46; }
.badge-rejeitado { background: #fee2e2; color: #991b1b; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--lighter-gray);
    color: var(--dark);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    opacity: 0.5;
    font-size: 0.82rem;
}

/* Landing Page */
.hero-landing {
    text-align: center;
    padding: 60px 0 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--dark) 100%);
    color: var(--white);
    border-radius: var(--radius-xl);
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-landing h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.hero-landing p {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 500px;
    margin: 0 auto;
}

.hero-cta {
    margin-top: 28px;
    padding: 16px 40px;
    font-size: 1.05rem;
    border-radius: 50px;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.step-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--light-gray);
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 auto 16px;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.step-card p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Features Landing */
.features-landing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.feature-landing {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--light-gray);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-landing:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-landing .feature-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.feature-landing h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.feature-landing p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    color: var(--white);
    border-radius: var(--radius-xl);
}

.cta-section h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.cta-section p {
    opacity: 0.7;
    margin-bottom: 24px;
    font-size: 1rem;
}

.cta-section .btn {
    border-radius: 50px;
    padding: 14px 36px;
}

/* Landing responsive */
@media (max-width: 768px) {
    .hero-landing {
        padding: 40px 20px;
    }
    .hero-landing h1 {
        font-size: 1.7rem;
    }
    .steps {
        grid-template-columns: 1fr;
    }
    .features-landing {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-landing h1 {
        font-size: 1.4rem;
    }
}

/* Login */
.login-container {
    max-width: 420px;
    margin: 50px auto;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    border: 1px solid var(--light-gray);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 28px;
    color: var(--dark);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .header .container {
        height: 56px;
    }
    
    .nav {
        gap: 4px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 0.82rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .resultado-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .resultado-item.destaque {
        grid-column: 1 / -1;
    }
    
    .bandeiras-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .admin-header .container {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
        gap: 8px;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    
    .admin-nav a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .botoes-acao {
        flex-direction: column;
    }
    
    .botoes-acao .btn {
        width: 100%;
    }
    
    .card {
        padding: 20px;
    }
    
    .resultado-simulacao {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 30px 0 20px;
    }
    
    .hero h1 {
        font-size: 1.35rem;
    }
    
    .bandeiras-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resultado-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 16px;
    }
}