/* ===== Design tokens (CM-739) =====
   The support/legal pages (return-policy, terms, privacy, info/about,
   cancellation-policy) are the only consumers of this stylesheet. These tokens
   mirror the home page's palette in /shared/frontend-shared.css so the support
   pages share its clean, gradient-free look (no more "AI-generated" purple
   gradient). Keep in sync with frontend-shared.css. */
:root {
    --color-bg-page:        #f5f5f5;
    --color-surface:        #ffffff;
    --color-surface-subtle: #f8fafc;
    --color-text-strong:    #111827;
    --color-text-heading:   #1f2937;
    --color-text:           #334155;
    --color-text-muted:     #586475;  /* WCAG AA 4.5:1 on light bg (CM-14) */
    --color-text-disabled:  #94a3b8;
    --color-primary:        #2563eb;
    --color-primary-hover:  #1d4ed8;
    --color-primary-subtle: #eff6ff;
    --color-primary-border: #bfdbfe;
    --color-border:         #e5e7eb;
    --shadow-card:          0 1px 3px rgba(0, 0, 0, 0.1);
    --color-env-test:       #b45309;  /* amber-700, white text 5.0:1 (CM-974) */
    --color-env-prod:       #b91c1c;  /* red-700, white text 6.5:1 (CM-974) */
    --color-env-local:      #6b7280;  /* gray, white text 4.8:1 */
}

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

/* ===== Accessibility ===== */

/* Skip navigation link - visible only on focus */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators - visible outlines for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== End Accessibility ===== */

.environment-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 1000;
    color: white;
    line-height: 1.3;
}

.environment-banner.test {
    background-color: var(--color-env-test);
}

.environment-banner.prod {
    background-color: var(--color-env-prod);
}

.environment-banner.local {
    background-color: var(--color-env-local);
}

/* Launched prod (CM-792): preview-banner.js removes the banner and adds this
   class; reclaim the fixed-banner space the legal-page layout reserves. */
body.no-env-banner {
    padding-top: 76px; /* 120px minus the 44px banner */
}

body.no-env-banner .auth-navbar {
    top: 0;
}

/* Auth Navbar */
.auth-navbar {
    position: fixed;
    top: 44px; /* Below environment banner */
    left: 0;
    right: 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    z-index: 999;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
}

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

.nav-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-text-strong);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.nav-brand:hover {
    opacity: 0.7;
}

.nav-brand:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.brand-tooltip {
    font-size: 0.85em;
    cursor: help;
    opacity: 0.6;
    color: var(--color-text-muted);
    transition: opacity 0.2s;
}

.brand-tooltip:hover {
    opacity: 1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--color-bg-page);
    min-height: 100vh;
    padding: 20px;
    padding-top: 120px; /* Account for env banner + navbar */
    color: var(--color-text);
}

.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 600px) {
    /* Compact banners for mobile. Banner text may wrap to 2 lines (CM-606),
       so reserve enough vertical room for that. */
    .environment-banner {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .auth-navbar {
        top: 52px; /* Below env banner (wrapped 2-line height on mobile) */
        padding: 8px 16px;
    }

    .nav-brand {
        font-size: 1.15rem;
    }

    body {
        padding-top: 100px; /* 52 banner + 48 nav (CM-606 banner may wrap on mobile) */
    }

    body.no-env-banner {
        padding-top: 48px; /* nav only — no banner on launched prod (CM-792) */
    }
}

/* Legal / Info Pages */
.legal-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.legal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-card);
}

.legal-card h1 {
    font-size: 2rem;
    color: var(--color-text-strong);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-align: left;
}

.legal-card .last-updated {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

.legal-card h2 {
    font-size: 1.3rem;
    color: var(--color-text-heading);
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.legal-card h3 {
    font-size: 1.1rem;
    color: var(--color-text-heading);
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-card p {
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-card ul,
.legal-card ol {
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 24px;
}

.legal-card li {
    margin-bottom: 6px;
}

.legal-card a {
    color: var(--color-primary);
    /* Underlined so inline prose links aren't distinguished by color alone
       (WCAG 1.4.1 / axe link-in-text-block). Nav/footer/button links are
       scoped elsewhere and unaffected. */
    text-decoration: underline;
}

.legal-card a:hover {
    text-decoration: underline;
}

.legal-card .contact-info {
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: 10px;
    margin-top: 24px;
}

.legal-card .contact-info p {
    margin-bottom: 4px;
}

.legal-card .disclaimer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Site Footer */
.site-footer {
    text-align: center;
    margin-top: 40px;
    padding: 28px 0 8px;
    border-top: 1px solid var(--color-border);
}

.site-footer .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.site-footer .footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus {
    color: var(--color-text);
    text-decoration: underline;
}

.site-footer .footer-links a[aria-current="page"] {
    font-weight: 600;
    color: var(--color-text);
}

.site-footer .footer-copy {
    /* muted (not disabled): informational copyright text must meet AA contrast */
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-top: 12px;
}

/* Info page specific */
.info-card {
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.info-card h2,
.info-card h3 {
    margin-top: 0;
    color: var(--color-text-heading);
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    color: var(--color-text-heading);
    margin-bottom: 6px;
}

@media (max-width: 600px) {
    .legal-card {
        padding: 28px 20px;
    }

    .legal-card h1 {
        font-size: 1.5rem;
    }

    .legal-card h2 {
        font-size: 1.15rem;
    }
}
