:root {
    --navy: #0D2B55;
    --orange: #FF6B2B;
    --gold: #FFB800;
    --ink: #0A0F1E;
    --paper: #F7F9FC;
    --gray: #5A6474;
    --light: #EEF2F7;
    --white: #FFFFFF;
    --royal: #1e3a8a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--paper);
    color: #1a1a2e;
}

/* ── HERO ── */
.legal-hero {
    background: var(--ink);
    padding: 120px 5% 70px;
    position: relative;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(255, 107, 43, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 10% 80%, rgba(13, 43, 85, 0.4) 0%, transparent 50%);
    pointer-events: none;
}

.legal-hero-in {
    max-width: 860px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.legal-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 184, 0, 0.12);
    border: 1px solid rgba(255, 184, 0, 0.3);
    color: var(--gold);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

.legal-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.legal-hero h1 em {
    color: var(--orange);
    font-style: normal;
}

.legal-hero p {
    color: #7a9bbf;
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 600px;
}

.legal-hero p strong {
    color: rgba(255, 255, 255, 0.7);
}

/* ── LAYOUT ── */
.legal-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    align-items: start;
    padding-top: 3rem;
    padding-bottom: 5rem;
}

/* ── SIDEBAR NAV ── */
.legal-nav {
    position: sticky;
    top: 90px;
}

.legal-nav-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gray);
    margin-bottom: 0.8rem;
}

.legal-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray);
    text-decoration: none;
    transition: background .15s, color .15s;
    margin-bottom: 0.2rem;
    border-left: 2px solid transparent;
}

.legal-nav a:hover {
    background: var(--light);
    color: var(--navy);
    border-left-color: var(--orange);
}

.legal-nav a.active {
    background: rgba(255, 107, 43, 0.08);
    color: var(--orange);
    font-weight: 700;
    border-left-color: var(--orange);
}

.legal-nav-divider {
    height: 1px;
    background: var(--light);
    margin: 1rem 0;
}

.legal-nav-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--gray);
    text-decoration: none;
    padding: 0.4rem 0;
    transition: color .15s;
}

.legal-nav-back:hover {
    color: var(--orange);
}

/* ── CONTENT ── */
.legal-content {
    min-width: 0;
}

.legal-updated {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light);
    color: var(--gray);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    margin-bottom: 2.5rem;
}

.legal-section {
    background: var(--white);
    border-radius: 16px;
    padding: 2.2rem 2.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--light);
    scroll-margin-top: 90px;
    transition: box-shadow .2s;
}

.legal-section:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.legal-section-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 1.5px solid var(--light);
}

.legal-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.legal-section-head h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.legal-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legal-section ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.65;
}

.legal-section ul li::before {
    content: '→';
    color: var(--orange);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 0.85rem;
}

/* ── CANCELLATION BLOCKS ── */
.policy-callout {
    background: linear-gradient(135deg, rgba(255, 107, 43, 0.08) 0%, rgba(13, 43, 85, 0.05) 100%);
    border: 1px solid rgba(255, 107, 43, 0.16);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    color: var(--navy);
    line-height: 1.7;
    margin-bottom: 1.4rem;
}

.policy-block+.policy-block {
    margin-top: 2rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--light);
}

.policy-block h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.02rem;
    color: var(--navy);
    margin-bottom: 0.7rem;
}

.policy-block h4 {
    font-size: 0.95rem;
    color: var(--navy);
    margin: 1.1rem 0 0.55rem;
}

.policy-block p {
    font-size: 0.92rem;
    color: var(--gray);
    line-height: 1.75;
    margin-bottom: 0.8rem;
}

.plan-rate-grid-wrap {
    margin: 1.2rem 0;
}

/* Top label */
.plan-rate-top-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

/* Container to align side label + table */
.plan-rate-grid-container {
    display: flex;
    align-items: stretch;
}

/* Side label */
.plan-rate-side-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gray);
    padding: 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table */
.plan-rate-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.plan-rate-grid th,
.plan-rate-grid td {
    border: 1px solid #1f2937;
    text-align: center;
    padding: 1.35rem 1rem;
    font-size: 1rem;
    color: var(--ink);
}

.plan-rate-grid thead th {
    font-weight: 600;
}

.plan-rate-grid tbody th {
    font-weight: 500;
}

/* Mobile */
@media (max-width: 768px) {
    .plan-rate-grid {
        min-width: 600px;
    }
}

.plan-rate-grid-wrap {
    margin: 1rem 0 1.1rem;
}

.plan-rate-top-label {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 0.55rem;
}

.plan-rate-grid-row {
    display: flex;
    align-items: stretch;
    gap: 0.85rem;
}

.plan-rate-side-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray);
    padding: 0.5rem 0;
}

.plan-rate-grid-shell {
    flex: 1;
    overflow-x: auto;
    border: 1px solid var(--light);
    border-radius: 14px;
    background: #fff;
}

.plan-rate-grid {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    background: #fff;
}

.plan-rate-grid th,
.plan-rate-grid td {
    padding: 0.95rem 1rem;
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--gray);
}

.plan-rate-grid thead th {
    background: #f8fafc;
    color: var(--navy);
    font-weight: 700;
}

.plan-rate-grid tbody th {
    background: #fff;
    color: var(--navy);
    font-weight: 700;
}

.plan-rate-grid tr:last-child th,
.plan-rate-grid tr:last-child td {
    border-bottom: none;
}

.plan-rate-grid th:last-child,
.plan-rate-grid td:last-child {
    border-right: none;
}

@media (max-width: 768px) {
    .plan-rate-grid-row {
        gap: 0.6rem;
    }

    .plan-rate-grid {
        min-width: 560px;
    }
}

.policy-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--light);
    border-radius: 14px;
    margin: 1rem 0 1.1rem;
    background: #fff;
}

.policy-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.policy-table th,
.policy-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--light);
    font-size: 0.88rem;
    line-height: 1.6;
}

.policy-table th {
    background: #f8fafc;
    color: var(--navy);
    font-weight: 700;
}

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

.policy-formula {
    background: var(--navy);
    color: #fff;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin: 1rem 0;
}

.policy-formula strong {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
}

@media (max-width: 768px) {
    .policy-table {
        min-width: 560px;
    }
}

/* ── PRIVACY POLICY BLOCKS ── */
.privacy-block {
    margin-bottom: 1.8rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--light);
}

.privacy-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.privacy-block h3 {
    font-family: 'Fraunces', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.7rem;
}

.privacy-block p {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.privacy-block p strong {
    color: var(--navy);
}

.privacy-block ul {
    margin-top: 0.5rem;
}

/* ── GOVERNING LAW BLOCK ── */
.legal-footer-block {
    background: var(--navy);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    margin-top: 1rem;
}

.legal-footer-block p {
    color: #7a9bbf;
    font-size: 0.85rem;
    line-height: 1.8;
}

.legal-footer-block p strong {
    color: rgba(255, 255, 255, 0.75);
}

.legal-footer-block p em {
    color: #5a7a9e;
    font-style: italic;
}

/* ── CONTACT CTA ── */
.legal-contact {
    background: linear-gradient(135deg, rgba(255, 107, 43, 0.08) 0%, rgba(13, 43, 85, 0.06) 100%);
    border: 1.5px solid rgba(255, 107, 43, 0.2);
    border-radius: 14px;
    padding: 1.6rem 2rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legal-contact p {
    font-size: 0.92rem;
    color: var(--navy);
    line-height: 1.6;
}

.legal-contact p strong {
    color: var(--orange);
}

.legal-contact a.btn-legal {
    background: var(--orange);
    color: #fff;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .2s;
}

.legal-contact a.btn-legal:hover {
    opacity: 0.88;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .legal-wrap {
        grid-template-columns: 1fr;
        padding-top: 2rem;
    }

    .legal-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        background: var(--white);
        border-radius: 12px;
        padding: 1rem;
        border: 1px solid var(--light);
    }

    .legal-nav-title,
    .legal-nav-divider,
    .legal-nav-back {
        display: none;
    }

    .legal-nav a {
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 6px;
        font-size: 0.78rem;
        padding: 0.4rem 0.7rem;
    }

    .legal-nav a:hover,
    .legal-nav a.active {
        border-left: none;
        border-bottom-color: var(--orange);
    }

    .legal-section {
        padding: 1.5rem;
    }

    .legal-footer-block {
        padding: 1.5rem;
    }
}