/* ============================================
   DETROIT MANAGEMENT CONSULTANT - Design System
   Premium - Modern - Trustworthy
   ============================================ */
:root {
    --blue: #3d6b8e;
    --blue-dark: #2c4f6b;
    --blue-light: #5a8fb4;
    --navy: #1a2332;
    --navy-light: #243447;
    --slate: #4a5568;
    --gray: #718096;
    --gray-light: #a0aec0;
    --border: #e2e8f0;
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --text: #1a202c;
    --text-body: #4a5568;
    --text-light: #718096;
    --radius: 6px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text-body); line-height: 1.7; font-size: 16px; background: var(--bg); -webkit-font-smoothing: antialiased; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--blue-dark); }
h1, h2, h3, h4, h5 { color: var(--text); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
.section-label { display: inline-block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--blue); margin-bottom: 12px; }
.section-title { margin-bottom: 16px; }
.section-subtitle { font-size: 1.1rem; color: var(--text-light); max-width: 600px; line-height: 1.7; }
.text-center { text-align: center; }
.section-subtitle.text-center { margin-left: auto; margin-right: auto; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px; border: none; border-radius: var(--radius); font-family: var(--font); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); text-decoration: none; letter-spacing: 0.01em; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(61,107,142,0.35); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.5); }
.btn-outline:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--bg-alt); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--blue); padding: 14px 0; }
.btn-ghost:hover { color: var(--blue-dark); }
.btn-ghost .arrow { transition: transform 0.3s; display: inline-block; }
.btn-ghost:hover .arrow { transform: translateX(4px); }
.btn-lg { padding: 18px 40px; font-size: 1rem; }
.btn-sm { padding: 10px 22px; font-size: 0.85rem; }

/* HEADER */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    overflow: visible;
}
.site-header.scrolled { box-shadow: var(--shadow); }
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    overflow: visible;
}
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { height: 60px; width: auto; display: block; }
.logo-img-footer { height: 32px; width: auto; display: block; }

/* NAV - Desktop */
.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-item { padding: 8px 16px; font-size: 0.9rem; font-weight: 500; color: var(--slate); border-radius: var(--radius); transition: var(--transition); }
.nav-item:hover { color: var(--blue); background: var(--bg-alt); }
.nav-item.active { color: var(--blue); }
.nav-cta { background: var(--blue); color: #fff !important; margin-left: 8px; border-radius: var(--radius); }
.nav-cta:hover { background: var(--blue-dark) !important; }

/* Mobile toggle - hidden on desktop */
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: var(--transition); border-radius: 2px; }

/* HERO */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: visible;
    margin-top: 80px;
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; z-index: 0; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(26,35,50,0.82) 0%, rgba(44,79,107,0.65) 100%); z-index: 0; }
.hero-content { position: relative; z-index: 1; max-width: 680px; padding: 80px 0; }
.hero .container { width: 100%; }
.hero h1 { color: #fff; font-size: clamp(2.5rem, 5.5vw, 3.8rem); font-weight: 700; line-height: 1.12; margin-bottom: 24px; letter-spacing: -0.03em; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.15rem; line-height: 1.8; margin-bottom: 36px; max-width: 520px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-sm { min-height: 420px; margin-top: 80px; }
.hero-sm .hero-content { padding: 60px 0; }
.hero-sm h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }

/* SECTIONS */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--navy); color: rgba(255,255,255,0.85); }
.section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark .section-label { color: var(--blue-light); }

/* CARDS */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px 32px; transition: var(--transition); }
.card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border-radius: var(--radius-lg); margin-bottom: 24px; font-size: 1.5rem; color: var(--blue); }
.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* STATS */
.stat { text-align: center; padding: 20px; }
.stat-number { font-size: 2.8rem; font-weight: 700; color: var(--blue-light); line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 0.9rem; color: rgba(255,255,255,0.7); }

/* STEPS */
.step { text-align: center; padding: 20px; position: relative; }
.step-number { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: var(--bg-alt); border: 2px solid var(--border); border-radius: 50%; font-size: 1.3rem; font-weight: 700; color: var(--blue); margin: 0 auto 20px; }
.step h3 { margin-bottom: 8px; }
.step p { color: var(--text-light); font-size: 0.9rem; }

/* PORTAL */
.portal-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.portal-features { list-style: none; }
.portal-features li { padding: 12px 0; padding-left: 32px; position: relative; font-size: 1rem; color: rgba(255,255,255,0.85); }
.portal-features li::before { content: "\2713"; position: absolute; left: 0; color: var(--blue-light); font-weight: 700; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-family: var(--font); font-size: 1.05rem; font-weight: 600; color: var(--text); transition: var(--transition); }
.faq-question:hover { color: var(--blue); }
.faq-icon { flex-shrink: 0; width: 24px; height: 24px; position: relative; margin-left: 20px; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; background: var(--gray); transition: var(--transition); }
.faq-icon::before { width: 14px; height: 2px; top: 11px; left: 5px; }
.faq-icon::after { width: 2px; height: 14px; top: 5px; left: 11px; }
.faq-item.open .faq-icon::after { transform: rotate(90deg); opacity: 0; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-answer-inner { padding: 0 0 24px 0; color: var(--text-light); line-height: 1.8; font-size: 0.95rem; }

/* CTA BANNER */
.cta-banner { position: relative; padding: 80px 0; text-align: center; overflow: hidden; }
.cta-banner .hero-bg { opacity: 1; }
.cta-banner .hero-overlay { background: linear-gradient(135deg, rgba(26,35,50,0.88) 0%, rgba(44,79,107,0.78) 100%); }
.cta-banner .container { position: relative; z-index: 2; }
.cta-banner h2 { color: #fff; margin-bottom: 16px; }
.cta-banner p { color: rgba(255,255,255,0.8); font-size: 1.1rem; margin-bottom: 32px; max-width: 540px; margin-left: auto; margin-right: auto; }

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 28px; }
.contact-icon { flex-shrink: 0; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--bg-alt); border-radius: var(--radius-lg); font-size: 1.2rem; color: var(--blue); }
.contact-info-item h4 { margin-bottom: 4px; }
.contact-info-item p { margin-bottom: 0; color: var(--text-light); font-size: 0.95rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 0.95rem; color: var(--text); background: var(--bg); transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61,107,142,0.1); }
.form-group textarea { resize: vertical; min-height: 140px; }

/* LEGAL */
.legal-content { max-width: 760px; }
.legal-content h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.legal-content h3 { font-size: 1.15rem; margin: 28px 0 12px; }
.legal-content p, .legal-content li { margin-bottom: 12px; }
.legal-content ul { margin: 0 0 16px 24px; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border); }
.footer-main { padding: 64px 0 48px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; }
.footer-about p { color: var(--text-light); font-size: 0.9rem; margin-top: 16px; }
.footer-about .footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.9rem; color: var(--text-light); }
.footer-col a:hover { color: var(--blue); }
.footer-contact li { font-size: 0.9rem; color: var(--text-light); }
.footer-bottom { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 0.85rem; color: var(--gray-light); margin: 0; }
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { font-size: 0.85rem; color: var(--gray-light); }
.footer-legal a:hover { color: var(--blue); }

/* LOGIN PUBLIC */
.login-page-public { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 80px); margin-top: 80px; background: var(--bg-alt); }
.login-card-public { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.login-card-public .login-header { text-align: center; margin-bottom: 36px; }
.login-card-public .login-header h1 { font-size: 1.6rem; color: var(--text); margin-bottom: 8px; }
.login-card-public .login-header p { color: var(--text-light); margin-bottom: 0; }
.login-card-public .alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; }
.login-card-public .alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.login-card-public .btn { width: 100%; justify-content: center; }
.login-footer-public { text-align: center; margin-top: 24px; }
.login-footer-public a { color: var(--blue); font-size: 0.9rem; }

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-inner { grid-template-columns: 1fr; gap: 40px; }
    .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ============================================
   RESPONSIVE - MOBILE (SINGLE BLOCK)
   ============================================ */
@media (max-width: 768px) {
    /* Layout */
    .section { padding: 64px 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom .container { flex-direction: column; gap: 12px; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
    .stat-number { font-size: 2.2rem; }

    /* Header */
    .header-inner { height: 64px; overflow: visible; }
    .logo-img { height: 44px; }
    .logo-img-footer { height: 28px; }

    /* Hero */
    .hero { min-height: 70vh; margin-top: 64px; overflow: visible; }
    .hero-sm { min-height: 340px; margin-top: 64px; }
    .hero h1 { font-size: 2.2rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { text-align: center; justify-content: center; }

    /* Login */
    .login-page-public { margin-top: 64px; min-height: calc(100vh - 64px); }

    /* Mobile toggle */
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 10001 !important;
    }

    /* Mobile nav - THE ONLY RULE */
    nav#siteNav.site-nav {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: auto;
        inset: 64px 0 auto 0 !important;
        flex-direction: column;
        background: #ffffff;
        z-index: 10000 !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        border-bottom: 1px solid #e2e8f0;
        padding: 16px 24px;
        gap: 4px;
        overflow: visible !important;
    }

    nav#siteNav.site-nav.open {
        display: flex !important;
    }

    .nav-item { padding: 14px 16px; font-size: 1rem; }
    .nav-cta { text-align: center; margin-left: 0; margin-top: 8px; }

    /* Ensure nothing clips the nav */
    .hero-section,
    .hero-banner,
    .site-header,
    .header-inner,
    .header-wrap {
        overflow: visible !important;
    }
}

/* Logout form inline in nav */
.logout-form { display: inline; margin: 0; padding: 0; }
.logout-btn { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
