/* ================================================================
   PRIMEVISTA — LEGAL & INFORMATIONAL PAGES MASTER STYLESHEET
   Covers: Privacy Policy, Terms & Conditions, Accessibility,
           Cookie Policy, FAQ, 404, 403, 500 error pages
   Design tokens match the existing PrimeVista brand exactly.
================================================================ */

:root {
    --gold:           #D4AF37;
    --gold-low:       rgba(212, 175, 55, 0.18);
    --gold-whisper:   rgba(212, 175, 55, 0.06);
    --abyss:          #030d10;
    --abyss-mid:      #051d24;
    --abyss-light:    #0b3c49;
    --paper:          #fdfcf9;
    --paper-warm:     #f4f1ea;
    --ink:            #1a1a1a;
    --ink-mid:        #000000ce;
    --ink-dim:        rgba(255,255,255,0.55);
    --glass:          rgba(255,255,255,0.05);
    --transition:     0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --font-serif:     'Times New Roman', Times, serif ;
    --font-sans:      'Montserrat', system-ui, sans-serif;
}

/* ── BODY ──────────────────────────────────────────────────── */
body.legal-body {
    background: var(--abyss);
    color: #ffffff;
    font-family: var(--font-serif);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── PAGE HERO HEADER ───────────────────────────────────────── */
.legal-hero {
    position: relative;
    width: 100%;
    height: 30vh;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: var(--abyss);
}

.legal-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212,175,55,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(11,60,73,0.6) 0%, transparent 60%);
    z-index: 1;
}

/* Subtle decorative gold lines */
.legal-hero::before,
.legal-hero::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--gold-low), transparent);
    z-index: 2;
}
.legal-hero::before { top: 0; height: 40%; }
.legal-hero::after  { bottom: 0; height: 40%; }

.legal-hero-content {
    position: relative;
    z-index: 10;
    padding: 0 20px;
}

.legal-hero-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.legal-hero-tag .gold-line-centered {
    width: 50px;
    height: 1.5px;
    background: var(--gold);
    display: block;
}

.legal-hero-tag .tag-text {
    font-family: var(--font-serif);
    font-size: 8px;
    letter-spacing: 5px;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: 600;
}

.legal-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 300;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 18px;
}

.legal-hero h1 em {
    font-style: italic;
    color: var(--gold);
    font-weight: 300;
}

.legal-hero-meta {
    font-family: var(--font-serif);
    font-size: 8px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-top: 16px;
}

/* ── MAIN CONTENT AREA ──────────────────────────────────────── */
.legal-main {
    background: var(--paper);
    color: var(--ink);
    position: relative;
}

.legal-main::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--gold-low), transparent);
}

/* ── INNER LAYOUT ───────────────────────────────────────────── */
.legal-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 8% 120px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 80px;
    align-items: start;
}

/* ── SIDEBAR TABLE OF CONTENTS ──────────────────────────────── */
.legal-toc {
    position: sticky;
    top: 40px;
}

.legal-toc-title {
    font-family: var(--font-serif);
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(212,175,55,0.2);
}

.legal-toc nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--ink-mid);
    text-decoration: none;
    padding: 9px 14px;
    border-left: 2px solid transparent;
    transition: var(--transition);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.toc-link:hover,
.toc-link.active {
    color: var(--abyss-light);
    border-left-color: var(--gold);
    background: rgba(212,175,55,0.05);
    padding-left: 18px;
}

.toc-contact-box {
    margin-top: 40px;
    padding: 24px;
    border: 1px solid var(--gold-low);
    background: var(--paper-warm);
}

.toc-contact-box p {
    font-family: var(--font-serif);
    font-size: 11px;
    line-height: 1.7;
    color: var(--ink-mid);
    letter-spacing: 0.3px;
    margin-bottom: 14px;
}

.toc-contact-box a {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--abyss-light);
    text-decoration: none;
    border-bottom: 1px solid var(--gold-low);
    padding-bottom: 4px;
    transition: var(--transition);
    font-weight: 700;
}

.toc-contact-box a:hover {
    border-bottom-color: var(--gold);
    color: var(--gold);
}

/* ── CONTENT BODY ───────────────────────────────────────────── */
.legal-content {
    min-width: 0; /* prevent grid blowout */
}

/* Last updated notice */
.legal-updated {
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-mid);
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(212,175,55,0.15);
}

.legal-updated strong {
    color: var(--gold);
}

/* Section heading */
.legal-section {
    margin-bottom: 60px;
    scroll-margin-top: 40px;
}

.legal-section-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.legal-section-num {
    font-family: var(--font-serif);
    font-size: 14px !important;
    letter-spacing: 2px;
    color: var(--gold);
    font-weight: 700;
    min-width: 28px;
}

.legal-section h2 {
    font-family: var(--font-serif);
    font-size: clamp(22px, 2.5vw, 32px);
    font-weight: 400;
    color: var(--abyss);
    line-height: 1.2;
}

.legal-section p,
.legal-section li {
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 1.9;
    color: #3a3a3a;
    margin-bottom: 16px;
    font-weight: 300;
}

.legal-section strong {
    font-weight: 600;
    color: var(--abyss-light);
}

.legal-section ul,
.legal-section ol {
    padding-left: 0;
    list-style: none;
    margin-bottom: 20px;
}

.legal-section ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
}

.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 1px;
    background: var(--gold);
}

.legal-section ol {
    counter-reset: legal-counter;
}

.legal-section ol li {
    counter-increment: legal-counter;
    padding-left: 32px;
    position: relative;
    margin-bottom: 12px;
}

.legal-section ol li::before {
    content: counter(legal-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    font-family: var(--font-serif);
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

/* Divider between sections */
.legal-divider {
    width: 40px;
    height: 1px;
    background: var(--gold-low);
    margin: 50px 0;
}

/* Highlight / callout boxes */
.legal-callout {
    border-left: 3px solid var(--gold);
    background: rgba(212,175,55,0.04);
    padding: 24px 28px;
    margin: 30px 0;
}

.legal-callout p {
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    color: var(--abyss-light) !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

/* Contact / data table */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-family: var(--font-serif);
    font-size: 13px;
}

.legal-table th {
    background: var(--abyss-mid);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 10px;
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
}

.legal-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(212,175,55,0.1);
    color: var(--ink-mid);
    line-height: 1.6;
    vertical-align: top;
}

.legal-table tr:last-child td {
    border-bottom: none;
}

.legal-table tr:nth-child(even) td {
    background: rgba(212,175,55,0.02);
}

/* ── FAQ SPECIFIC ───────────────────────────────────────────── */
.faq-group {
    margin-bottom: 50px;
}

.faq-group-title {
    font-family: var(--font-serif);
    font-size: 9px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gold-low);
}

.faq-item {
    border-bottom: 1px solid rgba(212,175,55,0.1);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 0;
    text-align: left;
    gap: 20px;
    transition: var(--transition);
}

.faq-question:hover .faq-q-text { color: var(--abyss-light); }

.faq-q-text {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.3;
    transition: var(--transition);
}

.faq-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid var(--gold-low);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 14px;
    transition: var(--transition);
}

.faq-item.open .faq-icon {
    background: var(--gold);
    color: var(--abyss);
    border-color: var(--gold);
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.faq-answer-inner {
    padding: 0 0 24px 0;
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.9;
    color: #4a4a4a;
    font-weight: 300;
}

.faq-answer-inner a {
    color: var(--abyss-light);
    text-decoration: underline;
    text-decoration-color: var(--gold-low);
    transition: var(--transition);
}

.faq-answer-inner a:hover {
    text-decoration-color: var(--gold);
}

/* ── ACCESSIBILITY SPECIFIC ─────────────────────────────────── */
.a11y-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.a11y-feature-card {
    border: 1px solid var(--gold-low);
    padding: 28px 24px;
    background: var(--paper-warm);
    transition: var(--transition);
}

.a11y-feature-card:hover {
    border-color: var(--gold);
    background: white;
}

.a11y-feature-card i {
    font-size: 22px;
    color: var(--gold);
    margin-bottom: 14px;
    display: block;
}

.a11y-feature-card h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--abyss);
    margin-bottom: 8px;
}

.a11y-feature-card p {
    font-family: var(--font-serif);
    font-size: 12px;
    line-height: 1.6;
    color: var(--ink-mid);
    margin: 0;
}

/* Conformance badge */
.a11y-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border: 1px solid var(--gold-low);
    background: var(--paper-warm);
    font-family: var(--font-serif);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--abyss-light);
    font-weight: 600;
    margin: 6px 6px 6px 0;
}

.a11y-badge i {
    color: var(--gold);
}

/* ── COOKIE CONSENT BANNER ──────────────────────────────────── */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--abyss-mid);
    border-top: 1px solid var(--gold-low);
    padding: 24px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#cookie-banner.visible {
    transform: translateY(0);
}

.cookie-text {
    font-family: var(--font-serif);
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255,255,255,0.65);
    max-width: 680px;
    flex: 1;
}

.cookie-text a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid var(--gold-low);
}

.cookie-text a:hover {
    border-bottom-color: var(--gold);
}

.cookie-actions {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}

.btn-cookie-accept {
    background: var(--gold);
    color: var(--abyss);
    border: none;
    padding: 12px 28px;
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cookie-accept:hover {
    background: #fff;
}

.btn-cookie-decline {
    background: transparent;
    color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cookie-decline:hover {
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.7);
}

/* ── 404 / ERROR PAGES ──────────────────────────────────────── */
.error-page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 5%;
    background: var(--abyss);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.error-page-wrap::before {
    content: attr(data-code);
    position: absolute;
    font-family: var(--font-serif);
    font-size: clamp(160px, 25vw, 320px);
    font-weight: 300;
    color: rgba(212,175,55,0.04);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 1;
}

.error-content {
    position: relative;
    z-index: 2;
}

.error-code {
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 6px;
    color: var(--gold);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 28px;
    display: block;
}

.error-title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 300;
    margin-bottom: 20px;
    line-height: 1.1;
}

.error-title em {
    font-style: italic;
    color: var(--gold);
}

.error-desc {
    font-family: var(--font-serif);
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    max-width: 480px;
    margin: 0 auto 48px;
    line-height: 1.7;
    font-weight: 300;
}

.error-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-error-primary {
    background: var(--gold);
    color: var(--abyss);
    text-decoration: none;
    padding: 16px 36px;
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 700;
    transition: var(--transition);
}

.btn-error-primary:hover {
    background: #fff;
}

.btn-error-outline {
    border: 1px solid rgba(212,175,55,0.3);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 16px 36px;
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    transition: var(--transition);
}

.btn-error-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 60px 6% 80px;
    }

    .legal-toc {
        position: static;
        display: none; /* hide sidebar TOC on mobile — inline anchors used */
    }

    .legal-hero { height: 45vh; min-height: 300px; }
    .a11y-feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    #cookie-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .cookie-actions { width: 100%; }
    .btn-cookie-accept, .btn-cookie-decline { flex: 1; text-align: center; }
    .error-actions { flex-direction: column; align-items: center; }
}
