/* Logi public legal pages (LEGAL-PAGES). One static stylesheet, no build step, no scripts, no external fonts
   (CSP: default-src 'none'; style-src/font-src/img-src 'self').
   The tokens mirror the app's design system:
   - colours: mobile/lib/app/design/logi_colors.dart (LogiColors.dark / LogiColors.light, same token names);
   - spacing, radii, tap target, type scale, content width: mobile/lib/app/design/logi_tokens.dart;
   - glow: mobile/lib/app/design/logi_glow.dart (orange halo x glowStrength; wordmark rim).
   Dark is the default; light follows prefers-color-scheme. Logical properties throughout, so dir="rtl" mirrors it. */

@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: optional; src: url("../admin-assets/fonts/Nunito-Regular.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: optional; src: url("../admin-assets/fonts/Nunito-Bold.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: optional; src: url("../admin-assets/fonts/Nunito-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Noto Sans Arabic"; font-style: normal; font-weight: 400; font-display: optional; src: url("fonts/NotoSansArabic-Regular.ttf") format("truetype"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Noto Sans Arabic"; font-style: normal; font-weight: 700 800; font-display: optional; src: url("fonts/NotoSansArabic-Bold.ttf") format("truetype"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
    color-scheme: dark light;
    /* LogiTokens.fontFamily + fontFamilyFallback */
    --font: "Nunito", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    /* LogiTokens spacing / radii / sizes */
    --s-4: 4px; --s-8: 8px; --s-12: 12px; --s-16: 16px; --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-48: 48px;
    --r-control: 14px;   /* controlRadius */
    --r-card: 20px;      /* cardRadius */
    --r-overlay: 24px;   /* overlayRadius */
    --r-pill: 999px;
    --tap: 48px;         /* tapTarget */
    --content: 760px;    /* contentWidth */
    --measure: 70ch;

    /* LogiColors.dark */
    --bg: #0a0705;
    --surface: #16100c;
    --surface-2: #1e1510;
    --glass: #351804;
    --line: #2e2018;
    --text: #fff4e8;
    --muted: #b8a595;
    --orange: #ff7e00;
    --orange-text: #ff7e00;
    --orange-deep: #e05a00;
    --ink: #1a0e08;
    --card-edge: #ff7e00;
    --pill: #0b1018;         /* pillNavy */
    --pill-line: #2a3a55;    /* pillNavyLine */
    --spark: #ffb347;
    --green: #67cd67;        /* success / actionGreen / switchOn */
    --focus: #ff7e00;
    --glow: 1;               /* glowStrength */
    --wordmark-rim: drop-shadow(0 0 9px rgb(255 126 0 / 0.55));  /* wordmarkRim 0x8cff7e00, blur 9 */
    --halo: rgb(255 126 0 / 0.18);
}

@media (prefers-color-scheme: light) {
    :root {
        /* LogiColors.light: cream / tahini + orange */
        --bg: #f0dcbc;
        --surface: #f8ebd7;
        --surface-2: #fbf4e7;
        --glass: #f8ebd7;
        --line: #d3bd9c;
        --text: #2b1d16;
        --muted: #6a5a4e;
        --orange-text: #9a4106;
        --card-edge: rgb(255 126 0 / 0.38);
        --pill: #f8ebd7;
        --pill-line: #9a8362;    /* inputLine: >= 3:1 on the cream, so the pill edge is visible */
        --focus: #9a4106;
        --glow: 0.45;
        --wordmark-rim: drop-shadow(0 1px 1.2px rgb(43 29 22 / 0.45));  /* wordmarkRim 0x732b1d16, blur 1.2 */
        --halo: rgb(255 126 0 / 0.16);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 22rem at 50% -6rem, var(--halo), transparent 70%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;      /* LogiTokens.body 16 */
    line-height: 1.6;
    overflow-wrap: break-word;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
a { color: var(--orange-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.skip {
    position: absolute; inset-inline-start: var(--s-16); inset-block-start: -10rem;
    padding: var(--s-12) var(--s-16); border-radius: var(--r-control);
    background: var(--orange); color: var(--ink); font-weight: 700; text-decoration: none; z-index: 10;
}
.skip:focus { inset-block-start: var(--s-16); }

/* Header: the app's wordmark with its rim glow, the peeking fox, the language pills. */
.masthead-inner {
    max-width: calc(var(--content) + 18rem);
    margin-inline: auto;
    padding: var(--s-20) var(--s-20) var(--s-12);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-16);
}
.brand { display: inline-flex; align-items: flex-end; gap: var(--s-8); }
.wordmark { display: block; block-size: 3rem; inline-size: auto; filter: var(--wordmark-rim); }
.fox { display: block; block-size: 2.75rem; inline-size: auto; }

.languages ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-8); }
.pill {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-4);
    min-block-size: var(--tap); min-inline-size: var(--tap);
    padding: var(--s-8) var(--s-16);
    border: 1.5px solid var(--pill-line); border-radius: var(--r-pill);
    background: var(--pill); color: var(--text);
    font-weight: 700; text-decoration: none; line-height: 1.2;
}
.pill:hover { border-color: var(--orange); }
/* The current language: orange fill, ink text, a check mark and aria-current; never colour alone. */
.pill[aria-current="page"] {
    background: linear-gradient(to bottom, var(--orange), var(--orange-deep));
    border-color: var(--orange); color: var(--ink); font-weight: 800;
    box-shadow: 0 0 12px rgb(255 126 0 / calc(0.45 * var(--glow)));
}
.pill[aria-current="page"]::before { content: "✓" / ""; }

/* Body: text card at a comfortable measure; on wide screens a sticky table of contents beside it. */
.layout {
    max-width: calc(var(--content) + 18rem);
    margin-inline: auto;
    padding: var(--s-12) var(--s-16) var(--s-32);
    display: grid; gap: var(--s-24);
    grid-template-columns: minmax(0, 1fr);
}
.doc {
    min-inline-size: 0;
    max-inline-size: calc(var(--measure) + 2 * var(--s-32));
    padding: var(--s-24) var(--s-20);
    background: var(--surface);
    border: 1px solid var(--card-edge);
    border-radius: var(--r-card);
    box-shadow: 0 0 18px 1px rgb(255 126 0 / calc(0.32 * var(--glow)));   /* LogiGlow reminderCard */
}
.doc:focus { outline: none; }
.doc > * { max-inline-size: var(--measure); }

.doc h1 { font-size: 1.75rem; line-height: 1.3; font-weight: 800; margin-block: 0 var(--s-16); }   /* pageTitle 28/36 */
.doc h2 { font-size: 1.375rem; line-height: 1.36; font-weight: 700; margin-block: var(--s-32) var(--s-8); scroll-margin-block-start: var(--s-16); } /* sectionTitle 22/30 */
.doc h3 { font-size: 1.125rem; line-height: 1.45; font-weight: 700; margin-block: var(--s-24) var(--s-8); } /* cardTitle 18/26 */
.doc h2::before { content: ""; display: inline-block; inline-size: 0.5rem; block-size: 0.5rem; margin-inline-end: var(--s-8); vertical-align: middle; border-radius: var(--r-pill); background: var(--orange); box-shadow: 0 0 8px rgb(255 126 0 / calc(0.7 * var(--glow))); }
:lang(ar) .doc { font-size: 1.0625rem; line-height: 1.8; }   /* Arabic script needs a little more size and leading */
.doc p, .doc ul, .doc ol { margin-block: 0 var(--s-16); }
.doc ul, .doc ol { padding-inline-start: var(--s-24); }
.doc li + li { margin-block-start: var(--s-4); }
.doc li::marker { color: var(--orange-text); font-weight: 700; }
.doc strong { font-weight: 800; }
.doc code { font-size: 0.9em; padding-inline: var(--s-4); border-radius: 6px; background: var(--surface-2); overflow-wrap: anywhere; }
.doc hr { border: 0; border-block-start: 1px solid var(--line); margin-block: var(--s-24); }
.doc blockquote {
    margin: 0 0 var(--s-24); padding: var(--s-12) var(--s-16);
    border: 1px solid var(--line); border-inline-start: 4px solid var(--spark);
    border-radius: var(--r-control); background: var(--surface-2); color: var(--text);
}
.doc blockquote p:last-child { margin-block-end: 0; }
.doc table { display: block; max-inline-size: 100%; overflow-x: auto; border-collapse: collapse; margin-block: var(--s-8) var(--s-24); font-size: 0.9375rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: var(--s-8) var(--s-12); text-align: start; vertical-align: top; min-inline-size: 9rem; }
.doc th { background: var(--surface-2); font-weight: 800; }

.contents {
    padding: var(--s-16) var(--s-20);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
}
.contents-title { margin: 0 0 var(--s-8); font-size: 0.875rem; line-height: 1.43; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents a { display: block; padding-block: var(--s-8); color: var(--text); text-decoration: none; line-height: 1.35; }
.contents a:hover { color: var(--orange-text); text-decoration: underline; }

@media (min-width: 64rem) {
    .layout { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
    .contents { position: sticky; inset-block-start: var(--s-16); max-block-size: calc(100vh - 2 * var(--s-16)); overflow-y: auto; }
    .contents a { padding-block: var(--s-4); font-size: 0.875rem; }
    .doc { padding: var(--s-32); }
}

.footer { max-width: calc(var(--content) + 18rem); margin-inline: auto; padding: 0 var(--s-16) var(--s-48); }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-8) var(--s-16); }
.footer a { display: inline-flex; align-items: center; min-block-size: var(--tap); color: var(--muted); }
.footer a:hover { color: var(--orange-text); }

@media (max-width: 22rem) {
    .masthead-inner { padding-inline: var(--s-12); }
    .layout { padding-inline: var(--s-8); }
    .doc { padding-inline: var(--s-16); }
    .fox { display: none; }
}

@media (forced-colors: active) {
    .pill[aria-current="page"] { border-width: 3px; }
    .doc h2::before { display: none; }
}
