/* Variables & Premium SaaS Aesthetic Core */
:root {
    --bg-main: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --bg-dark-alt: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #0f172a; /* Slate 900 for serious B2B feel */
    --accent-hover: #1e293b;
    --border: #e2e8f0;
    --border-dark: #334155;
    --radius: 8px;
    --radius-lg: 16px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --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);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); color: var(--text-primary); background: var(--bg-main); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
svg { display: block; }

/* Typography System */
h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 600; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: 4rem; font-weight: 800; letter-spacing: -0.04em; color: #fff; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
p { color: var(--text-secondary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font-weight: 500; border-radius: var(--radius); transition: all 0.2s ease; cursor: pointer; border: 1px solid transparent; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1.125rem; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.2); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.mt-4 { margin-top: 1.5rem; }

/* Elements & Badges */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.875rem; font-weight: 500; margin-bottom: 1.5rem; background: rgba(255,255,255,0.1); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.1); }
.badge-dark { background: var(--bg-dark); color: #fff; border-color: var(--border-dark); }
.text-center { text-align: center; }
.muted { color: var(--text-muted); }

/* Layout Utilities */
.section-container { max-width: 1200px; margin: 0 auto; padding: 6rem 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }

/* Navbar */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: 72px; z-index: 100; transition: all 0.3s ease; border-bottom: 1px solid transparent; background: transparent; }
.navbar.scrolled { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border-bottom-color: var(--border); }
.navbar.scrolled .brand, .navbar.scrolled .nav-links a:not(.btn) { color: var(--text-primary); }
.navbar:not(.scrolled) .brand, .navbar:not(.scrolled) .nav-links a:not(.btn) { color: #fff; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 2.5rem; }
.nav-links a:not(.btn) { font-size: 0.875rem; font-weight: 500; transition: opacity 0.2s; }
.nav-links a:not(.btn):hover { opacity: 0.7; }

/* Hero Section */
.hero { position: relative; background: var(--bg-dark); min-height: 90vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8rem 2rem 4rem; overflow: hidden; }
.hero-glow { position: absolute; top: -10%; left: 50%; transform: translateX(-50%); width: 60vw; height: 50vh; background: radial-gradient(ellipse at center, rgba(148, 163, 184, 0.15) 0%, rgba(15, 23, 42, 0) 70%); pointer-events: none; }
.hero-container { position: relative; z-index: 10; max-width: 900px; margin: 0 auto; }
.text-gradient { background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-title { margin-bottom: 1.5rem; }
.hero-subtitle { color: #cbd5e1; font-size: 1.25rem; max-width: 700px; margin: 0 auto 3rem; font-weight: 400; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 1rem; }

/* Workflow Strip */
.workflow-strip { background: var(--bg-dark); border-top: 1px solid var(--border-dark); border-bottom: 1px solid var(--border); padding: 2rem; }
.workflow-container { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.workflow-step { display: flex; align-items: center; gap: 1rem; }
.step-num { font-family: monospace; font-size: 0.875rem; color: var(--text-muted); background: var(--bg-dark-alt); padding: 0.25rem 0.5rem; border-radius: 4px; }
.step-text { color: #f8fafc; font-weight: 500; font-size: 0.875rem; }
.workflow-divider { flex-grow: 1; height: 1px; background: var(--border-dark); margin: 0 2rem; }

/* Services & Cards */
.services { background: var(--bg-alt); }
.section-header { text-align: center; max-width: 600px; margin: 0 auto 4rem; }
.card { background: var(--bg-main); padding: 2.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: all 0.3s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.card-icon { width: 48px; height: 48px; background: var(--bg-alt); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-primary); margin-bottom: 1.5rem; }
.card h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

/* Split Data Workflow Section */
.split-section { padding: 8rem 2rem; background: var(--bg-main); border-bottom: 1px solid var(--border); }
.split-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.feature-list { margin-top: 2rem; list-style: none; }
.feature-list li { padding-left: 2rem; position: relative; margin-bottom: 1rem; color: var(--text-secondary); font-weight: 500; }
.feature-list li::before { content: '→'; position: absolute; left: 0; color: var(--text-muted); }
.glass-panel { background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: inset 0 2px 4px rgba(255,255,255,0.8), var(--shadow-lg); }
.glass-header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.dots span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; margin-right: 6px; }
.skeleton-line { height: 12px; background: #e2e8f0; border-radius: 4px; margin-bottom: 1rem; }
.skeleton-block { height: 60px; background: #e2e8f0; border-radius: var(--radius); margin: 1.5rem 0; }
.w-3-4 { width: 75%; } .w-1-2 { width: 50%; } .w-full { width: 100%; } .w-5-6 { width: 83%; }

/* Integration & Footer */
.integration { padding: 8rem 2rem; background: var(--bg-alt); }
.integration-desc { max-width: 700px; margin: 0 auto; font-size: 1.125rem; }
.footer { background: var(--bg-main); padding: 6rem 2rem 2rem; border-top: 1px solid var(--border); }
.cta-container { max-width: 600px; margin: 0 auto 5rem; }
.footer-bottom { max-width: 1200px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 2rem; text-align: center; font-size: 0.75rem; color: var(--text-muted); }

/* Premium Brand Lockup (pf-brand) */
.pf-brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; transition: opacity 0.2s ease; white-space: nowrap; }
.pf-brand:hover { opacity: 0.9; }

.pf-brand__mark {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    font-weight: 700; font-size: 0.95rem; letter-spacing: 0.05em;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pf-brand__text {
    font-weight: 400; font-size: 1.15rem; letter-spacing: -0.01em;
    transition: color 0.3s ease;
}
.pf-brand__text strong { font-weight: 700; letter-spacing: -0.02em; }

/* Navbar Top State (Dark Hero Background) */
#navbar:not(.scrolled) .pf-brand__mark {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
#navbar:not(.scrolled) .pf-brand__text { color: #ffffff; }

/* Navbar Scrolled State (Light Background) */
#navbar.scrolled .pf-brand__mark {
    background-color: var(--bg-dark);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}
#navbar.scrolled .pf-brand__text { color: var(--bg-dark); }

/* Fallback Core Form & Admin Layout Styles (Protects Existing Routes) */
.form-container, .admin-container { max-width: 800px; margin: 8rem auto 4rem; padding: 3rem; background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.pf-form-page { min-height: 100vh; background: linear-gradient(135deg, #0b1220 0%, #172033 46%, #f8fafc 46%, #f8fafc 100%); }
.pf-form-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 5.5rem 0; display: grid; grid-template-columns: 0.78fr 1fr; gap: 2.25rem; align-items: start; }
.pf-form-intro { position: sticky; top: 2rem; padding: 2.35rem; color: #fff; }
.pf-form-brand { display: inline-flex; margin-bottom: 3.25rem; font-weight: 800; font-size: 1.1rem; }
.pf-form-eyebrow { margin: 0 0 1rem; color: #d2a45e; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.pf-form-intro h1 { max-width: 560px; margin: 0; color: #fff; font-size: 3.05rem; letter-spacing: 0; line-height: 1.06; }
.pf-form-intro > p:not(.pf-form-eyebrow) { max-width: 520px; margin-top: 1.25rem; color: rgba(255, 255, 255, 0.76); font-size: 1.08rem; }
.pf-form-trust { display: grid; gap: 0.75rem; margin-top: 2rem; }
.pf-form-trust span { padding: 0.9rem 1rem; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius); background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.82); font-weight: 650; }
.pf-form-card { padding: 2.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.97); box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18); }
.pf-form-card-header { margin-bottom: 1.65rem; padding-bottom: 1.35rem; border-bottom: 1px solid var(--border); }
.pf-form-card-header h2 { margin: 0; color: var(--text-primary); font-size: 1.65rem; letter-spacing: 0; }
.pf-form-card-header p:not(.pf-form-eyebrow) { max-width: 620px; margin-top: 0.7rem; font-size: 0.95rem; }
.pf-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input, select, textarea { width: 100%; padding: 0.95rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; margin-bottom: 1.15rem; font-size: 1rem; background: var(--bg-alt); transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text-primary); box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.1); background: var(--bg-main); }
label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.875rem; color: var(--text-primary); }
.pf-form-section { margin: 0 0 1.2rem; padding: 1.15rem 1.15rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.pf-form-section legend { padding: 0 0.45rem; color: var(--text-primary); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pf-form-section--consent { background: var(--bg-alt); }
.checkbox-item input, .consent-item input { width: auto; margin: 0.25rem 0 0; }
.checkbox-item, .consent-item { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.consent-group { padding: 0; border: 0; border-radius: 0; background: transparent; }
.consent-item label { margin-bottom: 0; line-height: 1.5; }
.consent-item a { color: var(--accent); text-decoration: underline; }
.pf-form-submit { display: grid; gap: 0.9rem; margin-top: 1.25rem; }
.pf-form-submit p { margin: 0; color: var(--text-secondary); font-size: 0.88rem; }
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.back-link { display: inline-flex; margin-top: 1.25rem; color: var(--text-secondary); font-weight: 650; }
.errors { margin-bottom: 1.5rem; padding: 1rem 1.25rem; border: 1px solid #fecaca; border-radius: var(--radius); background: #fef2f2; color: #991b1b; }
.errors ul { margin-left: 1rem; }
.result-container { max-width: 720px; margin: 8rem auto 4rem; padding: 3rem; background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); text-align: center; }
.result-container h1 { color: var(--text-primary); font-size: 2.5rem; letter-spacing: 0; }
.explanation { margin: 1.5rem 0 2rem; }
.result-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.home-link, .new-application-link, .submit-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.85rem 1.35rem; border: 1px solid var(--accent); border-radius: var(--radius); font-weight: 700; font-size: 1rem; cursor: pointer; }
.home-link, .submit-btn { background: var(--accent); color: #fff; }
.submit-btn { width: 100%; }
.new-application-link { background: var(--bg-main); color: var(--accent); }
.legal-page h1 { color: var(--text-primary); font-size: 2.5rem; letter-spacing: 0; }
.legal-page h2 { margin-top: 1.75rem; font-size: 1.25rem; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 2rem; }
th, td { padding: 1rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.875rem; }
th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-alt); }
tr:hover td { background: var(--bg-alt); }

/* Error Pages Compatibility (404/500) */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: var(--bg-alt); }
.error-card { text-align: center; padding: 4rem 2rem; background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); max-width: 500px; width: 100%; margin: 2rem; }
.error-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 1rem; letter-spacing: -0.05em; }
.error-message { color: var(--text-secondary); margin-bottom: 2.5rem; }
.error-action { display: inline-block; background: var(--accent); color: #fff; padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 500; }

/* Animations (Linear Style) */
.fade-in { opacity: 0; transform: translateY(15px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .hero { min-height: 80vh; padding-top: 6rem; }
    .nav-links, .workflow-strip { display: none; }
    .split-container { grid-template-columns: 1fr; gap: 3rem; }
    .hero-cta { flex-direction: column; width: 100%; }
    .hero-cta .btn { width: 100%; }
    .pf-form-page { background: #f8fafc; }
    .pf-form-shell { width: min(100% - 28px, 1180px); padding: 2rem 0; grid-template-columns: 1fr; }
    .pf-form-intro { position: static; padding: 1.5rem 0; color: var(--text-primary); }
    .pf-form-brand, .pf-form-intro h1 { color: var(--text-primary); }
    .pf-form-brand { margin-bottom: 2rem; }
    .pf-form-intro h1 { font-size: 2.25rem; }
    .pf-form-intro > p:not(.pf-form-eyebrow) { color: var(--text-secondary); }
    .pf-form-trust span { border-color: var(--border); background: #fff; color: var(--text-secondary); }
    .pf-form-card { padding: 1.25rem; }
    .pf-form-grid { grid-template-columns: 1fr; gap: 0; }
}
