/* =========================================================
   HighPassCV - Shared Legal Page Styles
   Used by terms.html and privacy.html
   ========================================================= */

:root {
    --legal-primary: #002d62;
    --legal-primary-dark: #001f44;
    --legal-accent: #c5a059;
    --legal-accent-hover: #d4b982;
    --legal-text: #2f3744;
    --legal-text-light: #667085;
    --legal-white: #ffffff;
    --legal-bg: #f4f7fa;
    --legal-border: #e2e8f0;
    --legal-warning-bg: #fff8e8;
    --legal-warning-border: #ead39b;
    --legal-heading-font: "Poppins", sans-serif;
    --legal-body-font: "Inter", sans-serif;
    --legal-container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--legal-text);
    background: var(--legal-bg);
    font-family: var(--legal-body-font);
    line-height: 1.75;
}

.legal-page {
    display: block;
    min-height: 100vh;
    overflow: hidden;
}

.legal-container {
    width: min(100% - 40px, var(--legal-container));
    margin-inline: auto;
}

.legal-page h1,
.legal-page h2,
.legal-page h3 {
    margin-top: 0;
    color: var(--legal-primary);
    font-family: var(--legal-heading-font);
    line-height: 1.3;
}

.legal-page p {
    margin-top: 0;
}

.legal-page a {
    color: var(--legal-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(197, 160, 89, 0.72);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.legal-page a:hover,
.legal-page a:focus-visible {
    color: #9a7634;
}

.legal-page a:focus-visible {
    outline: 3px solid rgba(197, 160, 89, 0.38);
    outline-offset: 4px;
    border-radius: 4px;
}

/* =========================
   Hero
   ========================= */

.legal-hero {
    padding: 160px 0 78px;
    color: var(--legal-white);
    background:
        radial-gradient(circle at 85% 18%, rgba(197, 160, 89, 0.22), transparent 30%),
        linear-gradient(135deg, var(--legal-primary-dark) 0%, var(--legal-primary) 100%);
}

.legal-hero .legal-container {
    max-width: 860px;
    text-align: center;
}

.legal-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-bottom: 18px;
    padding: 7px 15px;
    border: 1px solid rgba(197, 160, 89, 0.5);
    border-radius: 999px;
    color: var(--legal-accent);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.legal-hero h1 {
    margin-bottom: 18px;
    color: var(--legal-white);
    font-size: clamp(2.35rem, 5vw, 4rem);
    letter-spacing: -0.035em;
}

.legal-hero > .legal-container > p:not(.legal-updated) {
    max-width: 720px;
    margin: 0 auto 18px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.06rem;
}

.legal-updated {
    margin-bottom: 0;
    color: var(--legal-accent);
    font-size: 0.9rem;
    font-weight: 700;
}

/* =========================
   Main legal content
   ========================= */

.legal-content-section {
    padding: 68px 0 96px;
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    align-items: start;
    gap: 36px;
}

/* =========================
   Sidebar
   ========================= */

.legal-sidebar {
    position: sticky;
    top: 108px;
}

.legal-sidebar-card {
    overflow: hidden;
    border: 1px solid var(--legal-border);
    border-radius: 18px;
    background: var(--legal-white);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.legal-sidebar-card > strong {
    display: block;
    padding: 20px 22px;
    color: var(--legal-white);
    background: var(--legal-primary);
    font-family: var(--legal-heading-font);
    font-size: 1rem;
}

.legal-sidebar-card nav {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 45, 98, 0.3) transparent;
}

.legal-sidebar-card nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--legal-text-light);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.legal-sidebar-card nav a:hover,
.legal-sidebar-card nav a:focus-visible {
    color: var(--legal-primary);
    background: rgba(197, 160, 89, 0.14);
    transform: translateX(2px);
}

/* =========================
   Article and sections
   ========================= */

.legal-article {
    min-width: 0;
    padding: 42px;
    border: 1px solid var(--legal-border);
    border-radius: 22px;
    background: var(--legal-white);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.legal-draft-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 36px;
    padding: 20px 22px;
    border: 1px solid var(--legal-warning-border);
    border-radius: 15px;
    color: #684f1f;
    background: var(--legal-warning-bg);
}

.legal-draft-notice > i {
    flex: 0 0 auto;
    margin-top: 4px;
    color: #a5771f;
    font-size: 1.25rem;
}

.legal-draft-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #5c4318;
    font-family: var(--legal-heading-font);
}

.legal-draft-notice p {
    margin-bottom: 0;
    font-size: 0.94rem;
    line-height: 1.6;
}

.legal-section {
    scroll-margin-top: 118px;
    padding: 34px 0;
    border-bottom: 1px solid var(--legal-border);
}

.legal-section:first-of-type {
    padding-top: 0;
}

.legal-section:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.legal-section h2 {
    margin-bottom: 17px;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
}

.legal-section p,
.legal-section li {
    color: var(--legal-text-light);
    font-size: 0.98rem;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul,
.legal-section ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.legal-section li {
    margin-bottom: 9px;
    padding-left: 4px;
}

.legal-section li::marker {
    color: var(--legal-accent);
    font-weight: 800;
}

.legal-section strong {
    color: var(--legal-text);
}

/* =========================
   Tablet
   ========================= */

@media (max-width: 980px) {
    .legal-hero {
        padding-top: 205px;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .legal-sidebar {
        position: static;
    }

    .legal-sidebar-card nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        overflow: visible;
    }
}

/* =========================
   Mobile
   ========================= */

@media (max-width: 700px) {
    .legal-container {
        width: min(100% - 28px, var(--legal-container));
    }

    .legal-hero {
        padding: 270px 0 58px;
    }

    .legal-hero h1 {
        font-size: clamp(2rem, 11vw, 2.8rem);
    }

    .legal-hero > .legal-container > p:not(.legal-updated) {
        font-size: 0.98rem;
    }

    .legal-content-section {
        padding: 42px 0 68px;
    }

    .legal-sidebar-card nav {
        grid-template-columns: 1fr;
    }

    .legal-article {
        padding: 28px 21px;
        border-radius: 18px;
    }

    .legal-draft-notice {
        padding: 17px;
    }

    .legal-section {
        scroll-margin-top: 255px;
        padding: 28px 0;
    }

    .legal-section h2 {
        font-size: 1.3rem;
    }

    .legal-section p,
    .legal-section li {
        font-size: 0.94rem;
    }
}

/* =========================
   Very small screens
   ========================= */

@media (max-width: 390px) {
    .legal-hero {
        padding-top: 285px;
    }

    .legal-article {
        padding-inline: 17px;
    }

    .legal-sidebar-card > strong {
        padding-inline: 18px;
    }
}

/* =========================
   Reduced motion
   ========================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}