/* ========================================
   Ascend — Shared Styles
   ======================================== */

:root {
    --navy: #1B365D;
    --navy-light: #2A4A7A;
    --navy-dark: #0F2340;
    /* --- Brand Track Accent ---------------------------------------------
       Mirrored in ascend-design-system.css. Pages that load only
       shared.css (no design-system) still get the AscendMed gold defaults.
       The body.track-* override blocks live in ascend-design-system.css.

       See ascend-design-system.css for full documentation. Note:
       --accent-glow, --accent-bg-tint, and --gold are literals (not var())
       because nested var() in a custom-property value resolves at the
       declaration site, not at the use site, breaking track switching.
       ----------------------------------------------------------------- */
    --accent: #C8A24E;
    --accent-rgb: 200, 162, 78;
    --accent-bright: #E8C078;
    --accent-dim: #B8902F;
    --accent-glow: rgba(200, 162, 78, 0.35);
    --accent-bg-tint: rgba(200, 162, 78, 0.08);
    --gold: #C8A24E;                /* literal; redeclared in body.track-* */
    --gold-light: #D4B76A;          /* unchanged — light variant not part of track system */
    --gold-pale: #F5EDD6;           /* unchanged — pale variant not part of track system */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --green: #2D8A6E;
    --red: #DC2F5A;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 8px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.07), 0 4px 8px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 24px 48px -8px rgba(0,0,0,0.08), 0 8px 16px -6px rgba(0,0,0,0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.65;
    overflow-x: hidden;
    font-size: 16px;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.02em; }

a {
    text-decoration: none;
    color: inherit;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    font-family: var(--font-sans);
    font-size: 0.938rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 3px solid rgba(27,54,93,0.3);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(27,54,93,0.2), 0 1px 2px rgba(27,54,93,0.12);
}

.btn-primary:hover {
    background: var(--navy-light);
    box-shadow: 0 6px 16px rgba(27,54,93,0.22), 0 2px 4px rgba(27,54,93,0.1);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(27,54,93,0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
    border-color: var(--navy);
    background: rgba(27,54,93,0.03);
}

.btn-secondary:active {
    background: rgba(27,54,93,0.06);
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
    box-shadow: 0 1px 3px rgba(var(--accent-rgb),0.2), 0 1px 2px rgba(var(--accent-rgb),0.12);
}

.btn-gold:hover {
    background: var(--gold-light);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb),0.28), 0 2px 4px rgba(var(--accent-rgb),0.1);
    transform: translateY(-1px);
}

.btn-gold:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(var(--accent-rgb),0.2);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

/* ---- Network Top Bar ---- */
.network-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--navy-dark);
    height: 32px;
    display: flex;
    align-items: center;
}

.network-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.network-name {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.network-tracks {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.network-tracks::-webkit-scrollbar { display: none; }

.track-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 100px;
    white-space: nowrap;
    border: none;
    cursor: default;
    font-family: var(--font-sans);
    transition: all 0.15s;
    text-decoration: none;
}

.track-pill.active {
    background: var(--navy-light);
    color: #fff;
    cursor: pointer;
}

.track-pill.active:hover {
    background: var(--navy);
}

.track-pill.disabled {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.3);
    position: relative;
}

.track-pill .pill-soon {
    font-size: 0.5rem;
    opacity: 0.6;
    margin-left: 2px;
}

/* ---- Navbar ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-100);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--navy);
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.02em;
}

/* ---- Navbar Center Tabs ---- */
.nav-center {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-tab {
    position: relative;
    padding: 8px 14px;
    padding-bottom: 20px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    outline: none;
}

.nav-tab:hover {
    color: var(--gray-800);
}

.nav-tab svg {
    transition: transform 0.2s ease;
    width: 10px;
    height: 10px;
}

.nav-tab:hover svg {
    transform: rotate(180deg);
}

/* ---- Navbar Right ---- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s;
    padding: 0;
}

.nav-theme-btn:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

/* ---- Mega Dropdown (Light) ---- */
.mega-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    width: 700px;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
    transition-delay: 100ms;
}

.nav-tab:hover .mega-dropdown,
.mega-dropdown:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}

.mega-dropdown > .mega-divider {
    width: 1px;
    background: #e5e7eb;
}

.mega-col {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
}

.mega-section-header {
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 16px;
}

.mega-feature-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background 100ms ease;
}

.mega-feature-group:hover {
    background: #f5f5f5;
}

.mega-icon-container {
    width: 36px;
    height: 36px;
    background-color: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-icon-container svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}

.mega-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mega-feature-title {
    font-family: Inter, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}

.mega-feature-desc {
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .mega-dropdown {
        grid-template-columns: 1fr;
        width: 320px;
    }
    .mega-dropdown > .mega-divider { display: none; }
}

/* ---- Nav Links (used by content pages) ---- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: var(--gray-800);
    background: var(--gray-50);
}

.nav-link.active {
    color: var(--navy);
    font-weight: 600;
    background: rgba(27,54,93,0.04);
}

/* ---- Nav Dropdown (Application Builder menu) ---- */
.nav-dropdown { position: relative; }
.nav-dd-trigger { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; font-size: 0.875rem; font-weight: 500; color: var(--gray-500); background: none; border: none; border-radius: var(--radius-sm); font-family: var(--font-sans); cursor: pointer; transition: color 0.15s, background 0.15s; }
.nav-dd-trigger svg { transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1); }
.nav-dropdown:hover .nav-dd-trigger svg { transform: rotate(180deg); }
.nav-dd-menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; background: var(--white); border: 1px solid var(--gray-100); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); min-width: 270px; z-index: 500; padding: 6px 0; }
.nav-dropdown:hover .nav-dd-menu { display: block; }
.dd-item { display: flex; align-items: center; gap: 8px; padding: 12px 20px; font-size: .875rem; font-weight: 500; color: var(--gray-600); transition: all 0.18s cubic-bezier(0.22, 0.61, 0.36, 1); }
a.dd-item:hover { background: var(--gray-50); color: var(--navy); }
.dd-disabled { color: var(--gray-300); cursor: default; pointer-events: none; }
.soon-badge { display: inline-block; padding: 2px 8px; background: var(--gray-100); color: var(--gray-400); font-size: .6rem; font-weight: 700; border-radius: 100px; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; margin-left: 4px; }

/* ---- Nav Sub-Dropdown (Personal Statement flyout) ---- */
.nav-sub-dropdown { position: relative; }
.dd-sub-trigger { position: relative; }
.dd-sub-trigger svg { transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1); }
.nav-sub-dropdown:hover .dd-sub-trigger svg { transform: rotate(180deg); }
.dd-sub-menu { display: none; position: absolute; left: 100%; top: 0; background: var(--white); border: 1px solid var(--gray-100); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); min-width: 240px; z-index: 501; padding: 6px 0; }
.nav-sub-dropdown:hover .dd-sub-menu { display: block; }

.nav-avatar {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 16px;
    flex-shrink: 0;
}
.nav-avatar::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    height: 14px;
}
.nav-avatar-btn{width:34px;height:34px;border-radius:50%;background:var(--white);border:1.5px solid var(--navy);color:var(--navy);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s;flex-shrink:0;padding:0}
.nav-avatar-btn:hover{background:rgba(27,54,93,.06)}
.nav-avatar-dd {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 230px;
    z-index: 500;
    overflow: hidden;
    padding: 6px 0;
}
.nav-avatar-dd.open { display: block; }
.nav-avatar-dd a,
.nav-avatar-dd button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: all 0.15s;
}
.nav-avatar-dd a:hover,
.nav-avatar-dd button:hover {
    background: var(--gray-50);
    color: var(--navy);
}
.avatar-dd-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}
.avatar-dd-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gray-400);
}

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    padding: 16px 32px;
    z-index: 999;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-lg);
}

.mobile-menu.open {
    display: flex;
}

.mobile-link {
    padding: 12px 16px;
    font-size: 0.938rem;
    font-weight: 500;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.mobile-link:hover,
.mobile-link.active {
    color: var(--navy);
    background: var(--gray-50);
}

/* ---- Mobile Overlay ---- */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--white);
    z-index: 2000;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

.mobile-overlay.open {
    display: flex;
}

.mobile-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.mobile-overlay-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: background 0.15s;
}

.mobile-overlay-close:hover {
    background: var(--gray-50);
}

.mobile-overlay-body {
    padding: 16px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-section-header {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    padding: 16px 12px 6px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.15s;
}

.mobile-nav-item:hover {
    background: var(--gray-50);
}

.mobile-nav-item svg {
    width: 18px;
    height: 18px;
    color: var(--gold);
    flex-shrink: 0;
}

.mobile-nav-item.sub-item {
    padding-left: 24px;
    font-size: 14px;
}

/* ---- Mobile Nav Extras ---- */
.mobile-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 8px 0;
}

.mobile-heading {
    display: block;
    padding: 8px 16px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
}

.mobile-sub {
    padding-left: 28px;
}

/* ---- Footer ---- */
.footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    padding: 56px 0 36px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.footer-brand {
    margin-bottom: 32px;
}

.footer-tagline {
    margin-top: 12px;
    font-size: 0.938rem;
    color: var(--gray-500);
    font-style: italic;
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.813rem;
    color: var(--gray-400);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .network-bar-inner,
    .back-bar-inner {
        padding: 0 20px;
    }

    .network-name {
        display: none;
    }

    .network-tracks {
        width: 100%;
        justify-content: center;
    }

    .nav-links {
        display: none !important;
    }

    .nav-center {
        display: none;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .nav-container {
        padding: 0 20px;
    }
}

/* Mobile tap-target minimum (WCAG AAA 44×44). Icons stay the same visual
   size — only the clickable area expands via min-width/height + flex centering. */
@media (max-width: 767px) {
    .nav-avatar-btn {
        min-width: 44px;
        min-height: 44px;
    }
    .nav-mobile-toggle {
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }
}

/* =========================================================================
   Mobile responsive pass 1 — site-wide cross-cutting fixes
   ========================================================================= */

/* iOS zoom-on-focus prevention: Safari auto-zooms when an input's font-size
   is below 16px on tap. This rule only applies on mobile so desktop typography
   keeps its original 14px scale. Excludes non-text inputs that don't trigger
   the zoom. !important is required because page-specific class rules (e.g.
   .fi { font-size: 14px }) have higher specificity and would otherwise win. */
@media (max-width: 768px) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]):not([type=reset]):not([type=hidden]):not([type=image]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* WCAG AAA 44×44 tap target — extra interactive elements that the previous
   nav-only block missed. Icons stay the same visual size; only the clickable
   area expands via min-width/height. */
@media (max-width: 767px) {
    .nav-logo {
        min-height: 44px;
    }
    .ln-theme-toggle,
    .nav-theme-btn,
    .theme-btn {
        min-width: 44px;
        min-height: 44px;
    }
    /* Avatar dropdown trigger lives in marketing-page navs at 34×34. Pad to
       44×44 without resizing the circular avatar visual. */
    .nav-avatar-btn {
        min-width: 44px;
        min-height: 44px;
    }
    /* Marketing-site hamburger (.nav-mobile-toggle) renders the three bars
       at intrinsic 22×~16px. Expand the hit area to 44×44 via padding so
       the icon stays the same size. */
    .nav-mobile-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 9px;
        align-items: center;
        justify-content: center;
    }
    .cm-mobile-pill {
        min-height: 44px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

/* Small-mobile (≤480px) padding compression — reclaim a few pixels for
   content on narrow Android viewports. */
@media (max-width: 480px) {
    .nav-container,
    .network-bar-inner,
    .back-bar-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
    .footer-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}
