/* ===========================================
   FORENSIC TERMINAL - Legal Pages
   Privacy Policy & Terms of Service
   =========================================== */

/* CSS Custom Properties - Match homepage/checkout */
:root {
    --bg-deep: #0f1419;
    --bg-surface: #1a2332;
    --bg-card: #1e2a3a;
    --border-subtle: #2d3f52;
    --accent-cyan: #00d4ff;
    --accent-teal: #40babd;
    --text-primary: #e4e8ec;
    --text-muted: #8b9caf;
    --text-dim: #5a6b7f;

    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;

    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ===========================================
   BASE STYLES
   =========================================== */
html {
    scroll-behavior: smooth;
}

.legal-page {
    background: var(--bg-deep);
    min-height: 100vh;
    color: var(--text-primary);
    font-family: var(--font-body);
}

/* Focus states for accessibility */
.legal-page a:focus,
.legal-page button:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

.legal-page a:focus:not(:focus-visible),
.legal-page button:focus:not(:focus-visible) {
    outline: none;
}

/* ===========================================
   HEADER
   =========================================== */
.legal-page .header {
    background: rgba(15, 20, 25, 0.98);
    border-bottom: 1px solid var(--border-subtle);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

@supports (backdrop-filter: blur(10px)) {
    .legal-page .header {
        background: rgba(15, 20, 25, 0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}

.legal-page .header .logo .text {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-weight: 600;
}

.legal-page .header .logo .highlight {
    color: var(--accent-cyan);
}

.legal-page .header .nav-link {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 500;
    transition: color 0.3s ease;
}

.legal-page .header .nav-link:hover {
    color: var(--accent-cyan);
}

/* Navbar toggler styling */
.legal-page .header .navbar-toggler {
    border: 1px solid var(--border-subtle);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
}

.legal-page .header .navbar-toggler .icon-bar {
    background: var(--text-muted);
    display: block;
    width: 22px;
    height: 2px;
    margin: 2px 0;
    transition: background 0.3s ease;
}

.legal-page .header .navbar-toggler:hover .icon-bar {
    background: var(--accent-cyan);
}

/* Desktop nav fix */
@media (min-width: 768px) {
    .legal-page .header .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }

    .legal-page .header .navbar-nav {
        display: flex !important;
        flex-direction: row;
        align-items: center;
    }

    .legal-page .header .nav-item {
        margin-left: 0.5rem;
    }

    .legal-page .header .navbar-toggler {
        display: none !important;
    }
}

/* Mobile menu */
@media (max-width: 767px) {
    .legal-page .header .navbar-collapse {
        background: var(--bg-surface);
        border-radius: 0 0 12px 12px;
        border: 1px solid var(--border-subtle);
        border-top: none;
        margin-top: 0.5rem;
        padding: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
    }

    .legal-page .header .navbar-collapse:not(.show) {
        display: none;
    }

    .legal-page .header .navbar-collapse.show {
        display: block !important;
    }

    .legal-page .header .navbar-nav {
        flex-direction: column;
    }

    .legal-page .header .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 6px;
    }

    .legal-page .header .nav-link:hover {
        background: var(--bg-card);
    }
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.legal-content {
    padding: 120px 0 80px;
    position: relative;
}

/* Circuit pattern background */
.legal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px),
        linear-gradient(var(--border-subtle) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    pointer-events: none;
}

.legal-content .container {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

/* ===========================================
   LEGAL HEADER
   =========================================== */
.legal-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.legal-header h1 {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* Terminal-style prefix */
.legal-header h1::before {
    content: '> ';
    color: var(--accent-cyan);
    font-weight: 400;
}

.legal-header .last-updated {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.legal-header .last-updated::before {
    content: '// ';
    color: var(--accent-teal);
}

/* ===========================================
   LEGAL BODY
   =========================================== */
.legal-body {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
}

.legal-body section {
    margin-bottom: 2.5rem;
}

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

/* Section headings */
.legal-body h2 {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.legal-body h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-teal);
    margin: 1.5rem 0 0.75rem;
}

/* Paragraphs */
.legal-body p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Lists */
.legal-body ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.legal-body li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Terminal-style bullet points */
.legal-body li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Links */
.legal-body a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.legal-body a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-cyan);
}

/* External link indicator */
.legal-body a[target="_blank"]::after {
    content: ' ↗';
    font-size: 0.75em;
    opacity: 0.7;
}

/* Long word overflow handling */
.legal-body p,
.legal-body li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Strong text */
.legal-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===========================================
   FOOTER
   =========================================== */
.legal-page .footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 2rem 0;
}

.legal-page .footer-links {
    margin-bottom: 1rem;
}

.legal-page .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.legal-page .footer-links a:hover {
    color: var(--accent-cyan);
}

.legal-page .copyright {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* ===========================================
   SCROLLBAR
   =========================================== */
.legal-page::-webkit-scrollbar {
    width: 8px;
}

.legal-page::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

.legal-page::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

.legal-page::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .legal-content {
        padding: 100px 0 60px;
    }

    .legal-content .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .legal-header h1 {
        font-size: 1.75rem;
    }

    .legal-body {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .legal-body h2 {
        font-size: 1.1rem;
    }

    .legal-body h3 {
        font-size: 0.95rem;
    }

    .legal-page .footer-links a {
        display: block;
        margin: 0.5rem 0;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .legal-header h1 {
        font-size: 1.5rem;
    }

    .legal-body {
        padding: 1rem;
    }

    .legal-body h2 {
        font-size: 1rem;
    }
}

/* ===========================================
   REDUCED MOTION
   =========================================== */
@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;
    }
}

/* ===========================================
   HIGH CONTRAST MODE
   =========================================== */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-muted: #e0e0e0;
        --text-dim: #c0c0c0;
        --border-subtle: #555555;
        --accent-cyan: #00ffff;
    }

    .legal-page a:focus,
    .legal-page button:focus {
        outline-width: 3px;
    }

    .legal-body {
        border-width: 2px;
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {
    .legal-page .header,
    .legal-page .footer {
        display: none;
    }

    .legal-page {
        background: white;
        color: black;
    }

    .legal-content {
        padding: 0;
    }

    .legal-content::before {
        display: none;
    }

    .legal-body {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .legal-header h1,
    .legal-body h2,
    .legal-body h3 {
        color: black;
    }

    .legal-body h2 {
        border-bottom-color: #ccc;
    }

    .legal-body p,
    .legal-body li {
        color: #333;
    }

    .legal-body a {
        color: black;
        text-decoration: underline;
    }
}
