/* AgiApp - Estilos Globais */
:root {
    --primary: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2d5a87;
    --accent: #c9a227;
    --accent-dark: #a8871f;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-700: #4b5563;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #059669;
    --info: #2563eb;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
    --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
    --header-h: 64px;
    --bottom-nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--white);
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    z-index: 1000;
    padding-top: env(safe-area-inset-top);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
}

.logo img { width: 40px; height: 40px; object-fit: contain; }

.nav-desktop { display: none; gap: 32px; align-items: center; }
.nav-desktop a { color: var(--gray-700); font-weight: 500; font-size: 0.9375rem; }
.nav-desktop a:hover { color: var(--primary); }
.nav-desktop a.btn-primary,
.nav-desktop a.btn-primary:hover { color: var(--white); }
.nav-desktop a.btn-outline { color: var(--primary); }
.nav-desktop a.btn-outline:hover { color: var(--white); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    min-width: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.25);
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30, 58, 95, 0.3); color: var(--white); }

.btn-accent {
    background: var(--accent);
    color: var(--dark);
    font-weight: 700;
}
.btn-accent:hover { background: var(--accent-dark); color: var(--white); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { min-height: 56px; padding: 16px 32px; font-size: 1rem; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-block:first-of-type { margin-top: 16px; }

/* Hero */
.hero {
    padding: calc(var(--header-h) + 60px + env(safe-area-inset-top)) 0 80px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    overflow: hidden;
    position: relative;
    scroll-margin-top: calc(var(--header-h) + 16px);
}

.hero-has-bg {
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-has-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, var(--hero-overlay, 0.7));
    z-index: 0;
}

.hero:not(.hero-has-bg)::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(30, 58, 95, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    gap: 48px;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--dark);
    margin-bottom: 20px;
}

.hero-content h1 span { color: var(--accent-dark); }

.hero-content p {
    font-size: 1.125rem;
    color: var(--gray-500);
    margin-bottom: 32px;
    max-width: 520px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-item strong { display: block; font-size: 1.5rem; color: var(--primary); }
.stat-item span { font-size: 0.8125rem; color: var(--gray-500); }

.hero-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.hero-card h3 { font-size: 1.125rem; margin-bottom: 20px; color: var(--dark); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }

.form-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-upload-group small {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.doc-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.doc-current img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}

.doc-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    padding: 24px 16px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition), background var(--transition);
}

.doc-upload-box:hover,
.doc-upload-box:focus-within {
    border-color: var(--primary);
    background: rgba(30, 58, 95, 0.04);
}

.doc-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.doc-upload-icon {
    font-size: 2rem;
    color: var(--primary);
}

.doc-upload-text {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.doc-upload-preview {
    display: none;
    width: 100%;
    max-width: 280px;
    margin-top: 8px;
}

.doc-upload-preview.has-image {
    display: block;
}

.doc-upload-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background: var(--white);
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    transition: border-color var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

.simulacao-result {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
    display: none;
}

.simulacao-result.active { display: block; }
.simulacao-result p { font-size: 0.875rem; color: var(--gray-700); margin-bottom: 4px; }
.simulacao-result strong { font-size: 1.25rem; color: var(--primary); }

/* Sections */
.section { padding: 80px 0; }
.section-muted { background: var(--gray-100); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--dark); margin-bottom: 12px; }
.section-header p { color: var(--gray-500); max-width: 560px; margin: 0 auto; }

.features-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all var(--transition);
}

.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.feature-card h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.875rem; color: var(--gray-500); }

.steps-grid { display: grid; gap: 32px; counter-reset: step; }

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.step-item h3 { font-size: 1.125rem; margin-bottom: 4px; }
.step-item p { font-size: 0.875rem; color: var(--gray-500); }

.cta-section {
    background: var(--primary-dark);
    color: var(--white);
    padding: 64px 0;
    text-align: center;
}

.cta-section h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 16px; }
.cta-section p { opacity: 0.9; margin-bottom: 32px; }
.cta-section .btn-accent { margin: 0 auto; }

/* Footer */
.site-footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 48px 0 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.footer-grid {
    display: grid;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand .logo { color: var(--white); margin-bottom: 12px; }
.footer-brand p { font-size: 0.875rem; }

.footer-links h4 { color: var(--white); font-size: 0.9375rem; margin-bottom: 16px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--gray-300); font-size: 0.875rem; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8125rem;
}

.footer-bottom a { color: var(--accent); }

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: all var(--transition);
}

.back-to-top.visible { display: flex; }
.back-to-top:hover { background: var(--primary-light); transform: translateY(-2px); }

/* Mobile menu */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--primary);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    padding: 16px 20px;
    z-index: 999;
    flex-direction: column;
    gap: 12px;
}

.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 12px 0; font-weight: 500; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
.mobile-nav a.btn-primary,
.mobile-nav a.btn-primary:hover { color: var(--white); border-bottom: none; }

/* Responsive */
@media (min-width: 768px) {
    .nav-desktop { display: flex; }
    .menu-toggle { display: none; }
    .hero-grid { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: repeat(3, 1fr); }
    .steps-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

@media (max-width: 767px) {
    .form-row { grid-template-columns: 1fr; }
    .hero-stats { grid-template-columns: 1fr; }
}
