:root {
    --bg-main: #f8fafc;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-alt: #f1f5f9;
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
}

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

img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ── Legal & Brand Header ── */
header.legal-header, header.brand-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-heading);
    font-weight: 800;
    font-size: 18px;
    text-decoration: none;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.btn-back-home {
    background: #f1f5f9;
    color: var(--text-heading);
    border: 1px solid var(--border-light);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-back-home:hover {
    background: #e2e8f0;
    color: var(--accent-hover);
}

/* ── Main Layout ── */
.legal-wrapper {
    max-width: 860px;
    margin: 40px auto 60px;
    padding: 0 20px;
}

.legal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 44px 48px;
    box-shadow: var(--shadow-md);
}

.doc-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.doc-meta {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.doc-intro {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 32px;
}

/* ── Section Styling ── */
.legal-section {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid #f1f5f9;
}

.legal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.legal-section h2 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
    line-height: 1.4;
}

.legal-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 16px 0 8px;
}

.legal-section p {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 12px;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section ul {
    margin: 10px 0 16px 20px;
}

.legal-section li {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 8px;
}

.contact-box {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 10px;
    font-size: 15px;
}

.contact-box a, .legal-section a {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.contact-box a:hover, .legal-section a:hover {
    text-decoration: underline;
}

/* ── Thank You Page Specific Styles ── */
.page-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
}

.thank-you-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    max-width: 720px;
    width: 100%;
    padding: 48px 36px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 24px;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.lead-text {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.next-steps-card {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    text-align: left;
    margin-bottom: 32px;
}

.next-steps-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-num {
    width: 28px;
    height: 28px;
    background: #e0e7ff;
    color: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-heading);
}

.step-content p {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.5;
}

.step-content code {
    background: #e2e8f0;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.btn-portal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-hover));
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    padding: 18px 36px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    transition: all 0.25s ease;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 20px;
}

.btn-portal:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.45);
}

.support-box {
    font-size: 14px;
    color: var(--text-muted);
}

.support-box a {
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
}

.support-box a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
footer.legal-footer, footer {
    background: #ffffff;
    color: var(--text-muted);
    padding: 36px 20px;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid var(--border-light);
}

footer.legal-footer a, footer a {
    color: var(--accent-primary);
    text-decoration: none;
    margin: 0 8px;
    font-weight: 500;
}

footer.legal-footer a:hover, footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ── Comprehensive Mobile Responsiveness ── */
@media (max-width: 768px) {
    header.legal-header, header.brand-header {
        padding: 12px 16px;
    }

    .brand-logo {
        font-size: 15px;
        gap: 8px;
    }

    .brand-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .btn-back-home {
        padding: 5px 12px;
        font-size: 12px;
    }

    .legal-wrapper {
        margin: 20px auto 40px;
        padding: 0 12px;
    }

    .legal-card {
        padding: 24px 18px;
        border-radius: 14px;
    }

    .doc-title {
        font-size: 24px;
    }

    .doc-intro {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .legal-section h2 {
        font-size: 17px;
    }

    .legal-section p, .legal-section li {
        font-size: 14px;
    }

    .page-wrapper {
        padding: 24px 12px;
    }

    .thank-you-card {
        padding: 28px 18px;
        border-radius: 16px;
    }

    .success-icon-wrap {
        width: 64px;
        height: 64px;
        font-size: 30px;
        margin-bottom: 18px;
    }

    .lead-text {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .next-steps-card {
        padding: 18px 14px;
    }

    .btn-portal {
        font-size: 16px;
        padding: 15px 24px;
        width: 100%;
        box-sizing: border-box;
    }
}
