:root {
    /* Stacking: header & dropdowns above page chrome, promos, and sticky CTAs */
    --z-sticky-cta: 4000;
    --z-site-header: 5000;
    --z-nav-dropdown: 5100;
    --z-nav-flyout: 5200;
    --z-mobile-drawer: 5300;
    --brand-primary: #16a34a;    
    --brand-primary-dark: #15803d;
    /* Warm accent for ratings / secondary emphasis (independent of brand hue) */
    --brand-accent: #f59e0b;
    --bg-primary: #ffffff;
    --bg-soft: #f8fafc;          
    --bg-dark: #0f172a;          
    --text-main: #0f172a;        
    --text-muted: #64748b;       
    --border-light: #e2e8f0;
    --transition: all 0.2s ease;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    /* Layout rhythm — aligns header, sections, footer */
    --layout-max: 1220px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    /* Surfaces & glows derived from backend theme (color-mix follows --brand-primary) */
    --brand-tint-subtle: color-mix(in srgb, var(--brand-primary) 7%, var(--bg-primary));
    --brand-tint-soft: color-mix(in srgb, var(--brand-primary) 12%, #ffffff);
    --brand-tint-strong: color-mix(in srgb, var(--brand-primary) 18%, #ffffff);
    --brand-glow-12: color-mix(in srgb, var(--brand-primary) 12%, transparent);
    --brand-glow-22: color-mix(in srgb, var(--brand-primary) 22%, transparent);
    --brand-glow-32: color-mix(in srgb, var(--brand-primary) 32%, transparent);
    --brand-glow-40: color-mix(in srgb, var(--brand-primary) 40%, transparent);
    --brand-border-soft: color-mix(in srgb, var(--brand-primary) 26%, var(--border-light));
}

/* GLOBAL FONT FIX */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-main);
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Minimal header for landing pages (no nav, 1:1 attention) */
.site-header-minimal .main-nav,
.site-header-minimal .header-actions,
.site-header-minimal .auth-group,
.site-header-minimal .btn-location { display: none !important; }
.site-header-minimal .header-left { gap: 0; }

/* Header Base */
.site-header {
    position: sticky; top: 0; z-index: var(--z-site-header, 5000);
    background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid color-mix(in srgb, var(--text-main) 6%, transparent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75),
        0 12px 40px -28px color-mix(in srgb, var(--text-main) 12%, transparent);
}

.header-container {
    max-width: var(--layout-max); 
    margin: 0 auto; 
    padding: 0.75rem 2rem;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    height: 70px;
}

.header-left {
    display: flex; align-items: center; gap: 2rem;
    min-width: 0;
}
.brand-logo { display: flex; align-items: center; flex-shrink: 0; }
.main-nav.desktop-only { flex: 1; min-width: 0; }

.nav-links { display: flex; align-items: center; gap: 1.15rem; list-style: none; margin: 0; padding: 0; flex-wrap: nowrap; }
.nav-links > li:not(.nav-item) > a {
    text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 0.875rem; transition: var(--transition); white-space: nowrap;
}
.nav-links > li:not(.nav-item) > a:hover { color: var(--brand-primary); }
.nav-links .nav-item .nav-link { font-size: 0.875rem; white-space: nowrap; }

/* Shorter top-level label on mid-width desktops */
.nav-pkg-label-short { display: none; }
@media (max-width: 1320px) {
    .nav-pkg-label-full { display: none; }
    .nav-pkg-label-short { display: inline; }
}
@media (max-width: 1180px) {
    .nav-links { gap: 0.85rem; }
    .header-left { gap: 1.25rem; }
    .header-actions { gap: 0.75rem; }
    .auth-group { gap: 0.65rem; padding-left: 0.85rem; }
    .btn-location { padding: 0.45rem 0.75rem; font-size: 0.8125rem; }
}

.header-actions { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }

.btn-location {
    display: flex; align-items: center; gap: 0.5rem;
    background: #ffffff; border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem; border-radius: 8px;
    cursor: pointer; font-weight: 600; font-size: 0.875rem;
    color: var(--text-main); transition: var(--transition);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-location:hover { border-color: #cbd5e1; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.btn-location .icon-pin { width: 16px; height: 16px; color: #ef4444; }
.btn-location .icon-chevron { width: 14px; height: 14px; color: var(--text-muted); }

.auth-group {
    display: flex; align-items: center; gap: 1.25rem;
    border-left: 1px solid var(--border-light); padding-left: 1.25rem;
}
.link-instructor { text-decoration: none; font-size: 0.85rem; font-weight: 500; color: #64748b; transition: var(--transition); }
.link-instructor:hover { color: var(--text-main); }

.btn-portal {
    text-decoration: none; padding: 0.6rem 1.25rem;
    background: var(--bg-dark); border: 1px solid var(--bg-dark);
    border-radius: 8px; color: #ffffff; font-weight: 600; 
    font-size: 0.875rem; transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
}
.btn-portal:hover { 
    background: #1e293b; border-color: #1e293b;
    transform: translateY(-1px); box-shadow: 0 6px 10px -2px rgba(15, 23, 42, 0.3);
}

/* ==========================================================================
   MULTI-LEVEL DROPDOWN
   ========================================================================== */
.main-nav .nav-item { position: relative; }
.main-nav .nav-link { display: flex; align-items: center; gap: 0.25rem; font-weight: 600; text-decoration: none; color: var(--text-main); }
.main-nav .nav-link:hover { color: var(--brand-primary); }

.dropdown-menu.multi-level {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    min-width: 292px; border-radius: 14px;
    box-shadow: 0 22px 40px -12px rgba(15, 23, 42, 0.16), 0 8px 16px -8px rgba(15, 23, 42, 0.1);
    border: 1px solid var(--border-light, #e2e8f0);
    padding: 0.4rem; opacity: 0; visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); z-index: var(--z-nav-dropdown, 5100);
}

.main-nav .nav-item.has-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(5px); }
.main-nav .nav-item.has-dropdown:hover .dropdown-icon { transform: rotate(180deg); }
.main-nav .nav-item.has-dropdown::after { content: ''; position: absolute; bottom: -15px; left: 0; width: 100%; height: 15px; }

/* Compact Resources dropdown (schedule, FAQ, schools, contact) */
.dropdown-menu--resources {
    min-width: 260px;
    padding: 0.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.resources-dd-link {
    display: block;
    padding: 0.62rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.resources-dd-link:hover {
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
    color: var(--brand-primary);
}

.dropdown-group { position: relative; border-radius: 10px; transition: background-color 0.18s ease, box-shadow 0.18s ease; }
.dropdown-group:hover {
    background: linear-gradient(90deg, color-mix(in srgb, var(--brand-primary) 7%, transparent) 0%, var(--bg-soft, #f8fafc) 42%);
    box-shadow: inset 2px 0 0 0 var(--brand-primary);
}

.dropdown-item-lead {
    display: flex; flex-direction: column; padding: 0.8rem 2.65rem 0.8rem 1rem; text-decoration: none; position: relative;
    gap: 0.15rem; border-radius: 10px;
}
.dropdown-title { color: var(--text-main); font-weight: 800; font-size: 0.96rem; letter-spacing: -0.02em; line-height: 1.2; }
.dropdown-category {
    color: var(--text-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
    line-height: 1.35; max-width: 16rem;
}

.flyout-icon { position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #94a3b8; transition: color 0.2s, transform 0.2s; }
.dropdown-group.has-flyout:hover .flyout-icon { color: var(--brand-primary); transform: translateY(-50%) translateX(2px); }

.flyout-menu {
    position: absolute; top: 0; left: 100%; margin-left: 0.35rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    min-width: 256px; border-radius: 14px;
    box-shadow: 0 22px 40px -12px rgba(15, 23, 42, 0.18), 0 8px 16px -8px rgba(15, 23, 42, 0.1);
    border: 1px solid var(--border-light, #e2e8f0);
    padding: 0.85rem 1rem; opacity: 0; visibility: hidden; transform: translateX(-8px);
    transition: opacity 0.2s ease-in-out, visibility 0.2s, transform 0.2s ease-in-out; z-index: var(--z-nav-flyout, 5200);
}

.dropdown-group.has-flyout::after { content: ''; position: absolute; top: 0; right: -15px; width: 15px; height: 100%; }
.dropdown-group.has-flyout:hover .flyout-menu { opacity: 1; visibility: visible; transform: translateX(0); }

.flyout-section { margin-bottom: 1.1rem; padding-bottom: 0.25rem; }
.flyout-section:last-child { margin-bottom: 0; }
.flyout-heading {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted);
    margin: 0 0 0.45rem 0; padding-bottom: 0.45rem; border-bottom: 1px solid var(--border-light);
    font-weight: 800;
}
.flyout-link {
    display: block; padding: 0.38rem 0.35rem 0.38rem 0.15rem; margin: 0 -0.15rem; border-radius: 6px;
    color: var(--text-main); text-decoration: none; font-size: 0.88rem; font-weight: 600; transition: color 0.18s, background 0.18s;
}
.flyout-link:hover {
    color: var(--brand-primary);
    background: color-mix(in srgb, var(--brand-primary) 9%, transparent);
}

/* ==========================================================================
   MOBILE & MODALS
   ========================================================================== */
.mobile-menu-toggle { display: none; }
.mobile-drawer { display: none; }

@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .header-container { padding: 0.75rem 1.25rem; height: 64px; }
    .mobile-menu-toggle {
        display: flex; align-items: center; justify-content: center;
        background: transparent; border: none; padding: 0.4rem;
        min-width: 44px; min-height: 44px;
        color: var(--text-main); cursor: pointer; border-radius: 10px;
        transition: background 0.2s;
    }
    .mobile-menu-toggle:hover { background: var(--bg-soft); }
    .mobile-menu-icon {
        width: 26px; height: 26px; stroke: currentColor;
        display: block;
    }
    .mobile-menu-icon--close { display: none; }
    .mobile-menu-toggle.is-open .mobile-menu-icon--open { display: none; }
    .mobile-menu-toggle.is-open .mobile-menu-icon--close { display: block; }
    .mobile-drawer {
        display: flex; position: absolute; top: 100%; left: 0; right: 0;
        background: #ffffff; flex-direction: column;
        padding: 0.65rem 1rem 1rem;
        gap: 0.65rem;
        max-height: min(78vh, calc(100vh - 56px));
        max-height: min(78dvh, calc(100dvh - 56px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12); border-bottom: 1px solid var(--border-light);
        opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: var(--z-mobile-drawer, 5300);
    }
    .mobile-drawer.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .mobile-nav {
        display: flex; flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        text-align: left;
    }
    .mobile-nav > a {
        font-size: 1rem; font-weight: 700;
        color: var(--text-main); text-decoration: none;
        padding: 0.55rem 0.4rem; border-radius: 10px;
        transition: background 0.15s, color 0.15s;
    }
    .mobile-nav > a:hover { color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 6%, transparent); }
    .mobile-dropdown { display: flex; flex-direction: column; gap: 0.15rem; }
    .mobile-dropdown-trigger {
        display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
        width: 100%; background: none; border: none;
        font-size: 1rem; font-weight: 700;
        color: var(--text-main); cursor: pointer;
        padding: 0.55rem 0.4rem; font-family: inherit;
        text-align: left; border-radius: 10px;
        transition: background 0.15s, color 0.15s;
    }
    .mobile-dropdown-trigger:hover { background: var(--bg-soft); color: var(--brand-primary); }
    .mobile-dropdown-trigger .chevron { width: 18px; height: 18px; transition: transform 0.2s; flex-shrink: 0; opacity: 0.75; }
    .mobile-dropdown-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
    .mobile-dropdown-panel {
        display: flex; flex-direction: column; gap: 0.25rem;
        padding: 0.35rem 0.45rem 0.55rem;
        margin: 0.1rem 0 0.35rem;
        background: var(--bg-soft);
        border-radius: 12px;
        border: 1px solid color-mix(in srgb, var(--text-main) 8%, transparent);
    }
    .mobile-dropdown-panel[hidden] { display: none !important; }
    .mobile-subgroup {
        display: flex; flex-direction: column; gap: 0.2rem;
        padding-bottom: 0.5rem; margin-bottom: 0.4rem;
        border-bottom: 1px solid color-mix(in srgb, var(--text-main) 9%, transparent);
    }
    .mobile-subgroup:last-child {
        border-bottom: none; margin-bottom: 0; padding-bottom: 0;
    }
    .mobile-subgroup-label {
        display: block;
        font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
        letter-spacing: 0.07em; color: var(--text-muted);
        text-align: left;
        line-height: 1.35;
        margin: 0.35rem 0 0.15rem;
    }
    .mobile-subgroup > .mobile-subgroup-label:first-child { margin-top: 0; }
    .mobile-dropdown-panel a {
        font-size: 0.92rem; font-weight: 600;
        text-align: left;
        text-decoration: none;
        color: var(--text-main);
        padding: 0.48rem 0.55rem;
        border-radius: 8px;
        transition: background 0.15s, color 0.15s;
    }
    .mobile-dropdown-panel a:hover {
        background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
        color: var(--brand-primary);
    }
    .mobile-actions {
        display: flex; flex-direction: column; gap: 0.55rem;
        border-top: 1px solid var(--border-light);
        padding-top: 0.75rem;
        margin-top: 0.15rem;
    }
    .mobile-full { width: 100%; justify-content: center; text-align: center; padding: 0.85rem 1rem; }
}

body.mobile-nav-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .header-container { padding: 0.6rem 1rem; }
    .brand-logo img { max-height: 32px !important; }
}

.modern-modal {
    border: 1px solid var(--border-light); border-radius: 16px; padding: 2.5rem; max-width: 500px; width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); background: var(--bg-primary); margin: auto;
}
.modern-modal::backdrop { background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); }
.modal-header h2 { margin-top: 0; font-size: 1.5rem; }
.modal-header p { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; line-height: 1.5;}
.modal-close {
    position: absolute; top: 1.5rem; right: 1.5rem; background: var(--bg-soft); border: none; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: var(--transition);
}
.modal-close:hover { background: #e2e8f0; color: var(--text-main); }
.location-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.location-card {
    background: #ffffff; border: 1px solid var(--border-light); border-radius: 12px;
    padding: 1.25rem; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: var(--transition);
}
.location-card:hover { border-color: var(--brand-primary); box-shadow: 0 4px 14px -2px var(--brand-glow-22); }
.location-card h3 { margin: 0; font-size: 1.05rem; color: var(--text-main); font-weight: 600;}
.loc-phone { font-size: 0.85rem; color: var(--text-muted); font-weight: 500;}