/* Privacy policy and terms pages: hero, contents, numbered section cards, one language at a time. */
@font-face {
    font-family: "Righteous";
    font-display: swap;
    src: url("/app/assets/fonts/righteous-latin.woff2") format("woff2");
}

* { box-sizing: border-box; }

html {
    background: var(--ns-bg);
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 50% -120px, rgba(229, 9, 20, .28), transparent 70%),
        radial-gradient(600px 300px at 100% 20%, rgba(229, 9, 20, .08), transparent 70%),
        var(--ns-bg);
    color: var(--ns-text);
    font-family: var(--ns-font);
    line-height: 1.75;
}

a { color: #fff; }
a:hover { color: var(--ns-red-hover); }

/* One language at a time. */
html[data-lang="en"] article[lang="ar"],
html[data-lang="ar"] article[lang="en"],
html[data-lang="en"] [data-l="ar"],
html[data-lang="ar"] [data-l="en"] { display: none; }
html:not([data-lang]) article[lang="ar"],
html:not([data-lang]) [data-l="ar"] { display: none; }

/* ---------- Top bar ---------- */
.legal-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px max(16px, calc((100% - 1040px) / 2));
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ns-border);
}

.legal-brand {
    flex: none;
    color: var(--ns-red);
    font-family: var(--ns-font-brand-en);
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
    letter-spacing: .02em;
    direction: ltr;
}

.legal-brand:hover { color: var(--ns-red); }

/* "TV" in white, as in the app. */
.legal-brand span {
    margin-inline-start: .18em;
    color: #fff;
}

.legal-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }

.legal-switch {
    padding: 7px 14px;
    border: 1px solid var(--ns-border-strong);
    border-radius: var(--ns-radius-control);
    color: var(--ns-text-muted);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s, color .2s;
}

.legal-switch:hover { border-color: #fff; color: #fff; }

.legal-lang {
    display: flex;
    padding: 3px;
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius-control);
    background: var(--ns-surface);
}

.legal-lang button {
    padding: 6px 14px;
    border: 0;
    border-radius: var(--ns-radius-control);
    background: transparent;
    color: var(--ns-text-muted);
    font: 600 14px var(--ns-font);
    cursor: pointer;
    transition: background .2s, color .2s;
}

.legal-lang button[aria-selected="true"] { background: var(--ns-red); color: #fff; }
.legal-lang button:focus-visible, .legal-switch:focus-visible, .legal-toc a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Layout ---------- */
main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

article {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-areas: "hero hero" "toc cards";
    column-gap: 28px;
    align-items: start;
}

.legal-hero { grid-area: hero; }
.legal-toc { grid-area: toc; }
.legal-card { grid-column: 2; }

/* ---------- Hero ---------- */
.legal-hero {
    padding: 56px 0 36px;
    text-align: center;
}

.legal-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--ns-red), #8f050c);
    box-shadow: 0 14px 40px var(--ns-red-glow);
}

.legal-icon::before {
    content: "";
    width: 30px;
    height: 30px;
    background: #fff;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.legal-icon-shield { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
.legal-icon-doc { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E"); }

.legal-hero h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 800;
    line-height: 1.2;
}

.legal-date {
    display: inline-block;
    margin: 14px 0 0;
    padding: 4px 14px;
    border: 1px solid var(--ns-border);
    border-radius: var(--ns-radius-control);
    background: var(--ns-surface);
    color: var(--ns-text-muted);
    font-size: 14px;
}

.legal-intro {
    max-width: 640px;
    margin: 18px auto 0;
    color: var(--ns-text-muted);
    font-size: 17px;
}

/* ---------- Contents ---------- */
.legal-toc {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--ns-border);
    border-radius: 18px;
    background: rgba(18, 18, 18, .7);
}

.legal-toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--ns-text-muted);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.legal-toc a:hover { background: var(--ns-surface-2); color: #fff; }

.legal-toc .legal-num {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

/* ---------- Section cards ---------- */
.legal-card {
    margin-bottom: 16px;
    padding: 24px 26px;
    border: 1px solid var(--ns-border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(26, 26, 26, .92), rgba(14, 14, 14, .92));
    transition: border-color .2s;
}

.legal-card:hover { border-color: var(--ns-border-strong); }
.legal-card:target { border-color: var(--ns-red); box-shadow: 0 0 0 1px var(--ns-red), 0 18px 50px rgba(229, 9, 20, .14); }

.legal-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.legal-num {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--ns-red-soft);
    color: var(--ns-red-hover);
    font-size: 15px;
    font-weight: 800;
}

.legal-card p,
.legal-card li {
    margin: 0;
    color: rgba(255, 255, 255, .84);
    font-size: 16px;
}

.legal-card p + p { margin-top: 10px; }

.legal-card ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-card li {
    position: relative;
    padding-inline-start: 22px;
}

.legal-card li::before {
    content: "";
    position: absolute;
    inset-inline-start: 2px;
    top: .72em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ns-red);
}

.legal-card li b { color: #fff; }

/* Contact buttons (filled from the support settings). */
.legal-contact { display: flex; flex-wrap: wrap; gap: 10px; }

.legal-contact-line {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--ns-border-strong);
    border-radius: 14px;
    background: var(--ns-surface-2);
    text-decoration: none;
    transition: border-color .2s, transform .2s;
}

.legal-contact-line:hover { border-color: var(--ns-red); transform: translateY(-2px); color: #fff; }
.legal-contact-line span { color: var(--ns-text-muted); font-size: 13px; }
.legal-contact-line b { color: #fff; font-size: 16px; text-align: start; }

/* ---------- Footer ---------- */
.legal-foot {
    padding: 28px 16px 40px;
    border-top: 1px solid var(--ns-border);
    color: var(--ns-text-faint);
    font-size: 14px;
    text-align: center;
}

.legal-foot a { color: var(--ns-text-muted); text-decoration: none; }
.legal-foot a:hover { color: #fff; }
.legal-copy { margin-top: 6px; }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
    article {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "hero" "toc" "cards";
    }

    .legal-card { grid-column: 1; }

    .legal-toc {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        margin-bottom: 20px;
    }
}

@media (max-width: 560px) {
    .legal-top { padding: 10px 12px; }
    .legal-brand { font-size: 22px; }
    .legal-switch { display: none; }
    .legal-hero { padding: 36px 0 24px; }
    .legal-card { padding: 20px 18px; border-radius: 18px; }
    .legal-card h2 { font-size: 18px; }
    .legal-contact-line { flex: 1 1 100%; }
}
