/**
 * Legal and policy pages (privacy, terms, cookie policy, contact, pricing, refunds, shipping).
 * Load after theme.css and mobile-ux.css. Tokens only: no hardcoded light backgrounds.
 */

/* ─── Layout ───────────────────────────────────────────────────── */
/* The public header is sticky, so the app's fixed-header body offset is not needed here. */
body {
    padding-top: 0;
}

.container,
.policy-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4) var(--space-8);
}

.content,
.policy-container {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.content {
    padding: var(--space-6) var(--space-4);
}

.policy-container {
    margin-top: var(--space-6);
    margin-bottom: var(--space-8);
    padding: var(--space-6) var(--space-4);
}

@media (min-width: 768px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }

    .content,
    .policy-container {
        padding: var(--space-8);
    }
}

/* ─── Typography ───────────────────────────────────────────────── */
.content h1,
.policy-header h1 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-2);
}

@media (min-width: 768px) {
    .content h1,
    .policy-header h1 {
        font-size: var(--text-4xl);
    }
}

.last-updated,
.policy-meta {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-6);
}

.content h2,
.policy-section h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-default);
}

.content h2:first-of-type {
    margin-top: var(--space-4);
    padding-top: 0;
    border-top: none;
}

.content h3,
.policy-section h3 {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
}

.content p,
.content ul,
.content ol,
.policy-section p,
.policy-section ul,
.policy-section ol {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.content ul,
.content ol,
.policy-section ul,
.policy-section ol {
    padding-left: var(--space-6);
}

.content li,
.policy-section li {
    margin-bottom: var(--space-2);
}

.content strong,
.policy-section strong {
    color: var(--text-primary);
    font-weight: var(--weight-semibold);
}

.content a,
.policy-section a {
    color: var(--text-brand);
    text-decoration: none;
}

.content a:hover,
.policy-section a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin-top: var(--space-4);
    font-weight: var(--weight-medium);
}

/* ─── Callouts ─────────────────────────────────────────────────── */
.highlight-box,
.info-box,
.contact-info {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin: var(--space-4) 0;
}

.highlight-box {
    border-left-color: var(--brand-amber);
}

/* ─── Cookie policy ────────────────────────────────────────────── */
.policy-header {
    text-align: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-default);
}

.policy-section {
    margin-bottom: var(--space-8);
}

.policy-section h2 {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.cookie-table {
    display: block;
    overflow-x: auto;
    margin: var(--space-4) 0;
}

.cookie-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.cookie-table th,
.cookie-table td {
    padding: var(--space-3);
    border: 1px solid var(--border-default);
    text-align: left;
    color: var(--text-secondary);
}

.cookie-table th {
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: var(--weight-semibold);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
}

.badge-required {
    background: rgba(52, 211, 153, 0.15);
    color: var(--text-green);
}

.badge-optional {
    background: var(--bg-hover);
    color: var(--text-brand);
}

.manage-cookies-btn {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin-top: var(--space-4);
    padding: 0 var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    background: var(--brand-primary);
    color: var(--bg-body);
    font: inherit;
    font-weight: var(--weight-semibold);
    cursor: pointer;
}

.manage-cookies-btn:hover {
    background: var(--brand-light);
}

/* ─── Footer ───────────────────────────────────────────────────── */
.footer-section {
    margin-top: auto;
    padding: var(--space-4) 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.footer-logo {
    width: 28px;
    height: 28px;
}

.footer-copyright {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.footer-link {
    padding: 2px 4px;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    text-decoration: none;
    white-space: nowrap;
}

.footer-link:hover {
    color: var(--text-brand);
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-faint);
    font-size: var(--text-xs);
    user-select: none;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .footer-brand {
        flex-direction: row;
        gap: var(--space-3);
    }

    .footer-nav {
        justify-content: flex-end;
    }
}
