/* EMSCE Radar Unified Legal / Help Page Styles
   Save as: /assets/legal.css

   Purpose:
   Make privacy/support/terms/contact/data-source pages match the main EMS CE Radar site.
   This file intentionally uses the same visual language as the public class listing:
   clean white header, soft teal/navy hero, same container width, same card style,
   and matching footer structure.
*/

:root {
    --brand-navy: #0B1D3A;
    --brand-navy-2: #123A6D;
    --brand-teal: #0BA3A6;
    --brand-aqua: #7EDBD5;
    --brand-orange: #FF8A00;
    --brand-light: #F3F6F9;

    --emsce-navy: var(--brand-navy);
    --emsce-teal: var(--brand-teal);
    --emsce-light-teal: var(--brand-aqua);
    --emsce-bg: var(--brand-light);
    --emsce-muted: #64748B;
    --emsce-border: #E2E8F0;
    --emsce-warning: #C2410C;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--brand-light);
}

body {
    margin: 0;
    background: var(--brand-light);
    color: var(--brand-navy);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

a {
    color: var(--brand-teal);
}

a:hover {
    color: var(--brand-navy-2);
}

/* ---------- Shared Layout ---------- */

.legal-container {
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
}

/* ---------- Header: match public site ---------- */

.legal-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.legal-header-inner {
    min-height: 78px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.legal-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--brand-navy);
    min-width: 0;
}

.legal-brand img {
    width: 260px;
    max-width: 46vw;
    height: auto;
    display: block;
}

.legal-brand-text {
    display: none;
}

.legal-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    color: var(--brand-navy);
    text-decoration: none;
}

.legal-nav a:hover {
    background: rgba(11, 163, 166, 0.10);
    color: var(--brand-teal);
}

/* ---------- Main ---------- */

.legal-main {
    padding: 44px 0 64px;
}

/* ---------- Hero: match site, but legal-page compact ---------- */

.legal-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 86% 15%, rgba(11, 163, 166, 0.16), transparent 28%),
        radial-gradient(circle at 15% 20%, rgba(126, 219, 213, 0.20), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 48%, #eef6f7 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    padding: 46px 44px;
    margin-bottom: 28px;
    box-shadow: 0 18px 44px rgba(11, 29, 58, 0.08);
}

.legal-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(11, 29, 58, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 29, 58, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(90deg, rgba(0,0,0,0.28), transparent 58%);
    pointer-events: none;
}

.legal-hero::after {
    content: "";
    position: absolute;
    right: -180px;
    top: -180px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    border: 1px solid rgba(11, 163, 166, 0.16);
    box-shadow:
        0 0 0 70px rgba(11, 163, 166, 0.045),
        0 0 0 140px rgba(11, 29, 58, 0.035),
        0 0 0 210px rgba(11, 163, 166, 0.025);
    pointer-events: none;
}

.legal-hero > * {
    position: relative;
    z-index: 2;
}

.legal-eyebrow {
    margin: 0 0 10px 0;
    color: var(--brand-teal);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 13px;
    font-weight: 900;
}

.legal-hero h1 {
    max-width: 760px;
    margin: 0;
    color: var(--brand-navy);
    font-size: clamp(2.25rem, 4vw, 3.65rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.legal-hero p {
    max-width: 760px;
    margin: 18px 0 0;
    color: #334155;
    font-size: clamp(1rem, 1.35vw, 1.16rem);
    line-height: 1.55;
}

/* ---------- Cards ---------- */

.legal-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-top: 4px solid var(--brand-teal);
    border-radius: 16px;
    padding: 28px;
    margin: 20px 0;
    box-shadow: 0 12px 30px rgba(11, 29, 58, 0.08);
}

.legal-card h2 {
    margin: 0 0 16px 0;
    color: var(--brand-navy);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.legal-card h3 {
    margin: 28px 0 10px;
    color: var(--brand-navy);
    font-size: 20px;
}

.legal-card p {
    color: #0f172a;
}

.legal-card ul {
    padding-left: 22px;
}

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

.legal-muted {
    color: var(--emsce-muted) !important;
}

.legal-callout {
    border-left: 5px solid var(--brand-teal);
    background: #EFFFFF;
    padding: 16px 18px;
    border-radius: 14px;
    margin: 20px 0;
}

.legal-warning {
    border-left-color: var(--emsce-warning);
    background: #FFF7ED;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* ---------- Buttons ---------- */

.legal-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.legal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    background: var(--brand-teal);
    color: white !important;
    border: 0;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(11, 29, 58, 0.10);
}

.legal-button:hover {
    filter: brightness(0.96);
    color: white !important;
}

.legal-button.secondary {
    background: var(--brand-navy);
}

.legal-button.outline {
    background: transparent;
    color: var(--brand-navy) !important;
    border: 2px solid var(--brand-teal);
    box-shadow: none;
}

.legal-button.outline:hover {
    background: rgba(11, 163, 166, 0.08);
    color: var(--brand-teal) !important;
}

/* ---------- Forms ---------- */

.legal-form {
    display: grid;
    gap: 16px;
}

.legal-form label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.legal-form input,
.legal-form select,
.legal-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    min-height: 48px;
    padding: 12px 14px;
    font: inherit;
    color: var(--brand-navy);
    background: white;
}

.legal-form input:focus,
.legal-form select:focus,
.legal-form textarea:focus {
    outline: 3px solid rgba(11, 163, 166, 0.18);
    border-color: var(--brand-teal);
}

.legal-form textarea {
    min-height: 150px;
    resize: vertical;
}

.legal-hidden {
    display: none !important;
}

.legal-alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--emsce-border);
}

.legal-alert.success {
    background: #ECFDF5;
    border-color: #BBF7D0;
    color: #166534;
}

.legal-alert.error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

/* ---------- Footer: align with main site footer ---------- */

.legal-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 46px 0 22px;
    color: var(--brand-navy);
}

.legal-footer-grid {
    display: grid;
    grid-template-columns: minmax(420px, 2.4fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(150px, 0.8fr);
    gap: 44px;
    align-items: start;
}

.legal-footer strong {
    display: block;
    margin: 0 0 12px 0;
    color: var(--brand-navy);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
}

.legal-footer a {
    display: block;
    margin: 8px 0;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

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

.legal-footer p {
    max-width: 600px;
    margin: 0 0 12px 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.legal-footer-bottom {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    color: var(--emsce-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .legal-header-inner {
        min-height: auto;
    }

    .legal-brand img {
        width: 230px;
        max-width: 60vw;
    }

    .legal-grid {
        grid-template-columns: 1fr;
    }

    .legal-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .legal-footer-grid > div:first-child {
        grid-column: 1 / -1;
        max-width: 720px;
    }
}

@media (max-width: 680px) {
    .legal-container {
        width: min(100% - 32px, 1180px);
    }

    .legal-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 0;
    }

    .legal-brand img {
        width: 235px;
        max-width: 92vw;
    }

    .legal-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .legal-nav a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .legal-main {
        padding: 30px 0 46px;
    }

    .legal-hero {
        padding: 34px 24px;
        border-radius: 18px;
    }

    .legal-card {
        padding: 22px;
    }

    .legal-footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
