/* Shared styling for iDrive's static pages (privacy, terms, delete-account, register).
   The same design system as the landing (site.css) and the account portal
   (account.css): the shared tokens live in /assets/tokens.css (loaded first).
   Light + dark: the OS setting applies unless the visitor chose a theme
   (data-theme on <html>, localStorage 'idrive-theme', toggled by legal.js). */

:root {
    /* Older names some page styles still use (register's inline form CSS). */
    --paper: var(--surface-2);
    --brand-tint: var(--brand-050);
    --brand-deep: var(--brand-700);
    --accent-tint: var(--warn-tint);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Assistant', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Rubik', sans-serif;
    color: var(--ink);
    background: var(--bg);
    background-image:
        radial-gradient(1100px 620px at 100% -10%, rgba(10, 124, 216, 0.10), transparent 60%),
        radial-gradient(900px 540px at -10% 8%, rgba(57, 160, 235, 0.08), transparent 55%);
    background-attachment: fixed;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}
html[lang="ar"] body { font-family: 'Cairo', 'Assistant', system-ui, sans-serif; }
/* Assistant has no Cyrillic: Russian uses the system UI face throughout. */
html[lang="ru"] body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- Header: the same full-width bar as the landing and /account (site-header.css) ---------- */
body > header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border-bottom: 1px solid var(--line);
}
.nav-shell {
    max-width: var(--site-maxw); margin: 0 auto; height: var(--site-header-h);
    padding: 0 var(--site-gutter);
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 26px; width: auto; }
.nav-right { display: flex; align-items: center; gap: 8px; }

.back-home {
    display: inline-flex; align-items: center; gap: 6px; height: 40px;
    color: var(--ink); background: var(--chip-bg); font-size: 0.9rem; font-weight: 600;
    padding: 0 14px; border-radius: var(--r-pill); transition: background 0.2s;
}
.back-home:hover { background: var(--chip-bg-hover); text-decoration: none; }
.back-home svg { width: 15px; height: 15px; }
html[dir="rtl"] .back-home svg { transform: scaleX(-1); }

.theme-toggle {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
    background: var(--chip-bg); border: none; cursor: pointer; color: var(--ink);
    border-radius: var(--r-pill); transition: background 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--chip-bg-hover); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:focus-visible, .lang-toggle:focus-visible, .back-home:focus-visible { outline: 3px solid var(--brand-glow); outline-offset: 2px; }

/* Language dropdown */
.lang { position: relative; }
.lang-toggle {
    display: inline-flex; align-items: center; gap: 7px; height: 40px;
    background: var(--chip-bg); border: none; cursor: pointer;
    font-family: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink);
    padding: 0 13px; border-radius: var(--r-pill); transition: background 0.2s;
}
.lang-toggle:hover { background: var(--chip-bg-hover); }
.lang-toggle svg { width: 16px; height: 16px; opacity: 0.8; }
.lang-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 10px);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--shadow-lg);
    padding: 6px; min-width: 176px; display: none; overflow: hidden;
    animation: menu-in 0.16s var(--ease-out);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.lang-menu.open { display: block; }
.lang-menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 0.95rem; font-weight: 500; color: var(--ink); text-align: start;
    padding: 10px 12px; border-radius: 11px; transition: background 0.14s;
}
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button.active { background: var(--brand-050); color: var(--brand-700); font-weight: 700; }
.lang-menu .flag { font-size: 1.1rem; }

/* ---------- Buttons (register's submit) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
    border: 1.5px solid transparent; border-radius: var(--r-pill); padding: 13px 24px;
    transition: transform 0.14s var(--ease), box-shadow 0.22s var(--ease), background 0.2s;
    text-decoration: none; line-height: 1.1;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:focus-visible { outline: 3px solid var(--brand-glow); outline-offset: 2px; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 30px -6px var(--brand-glow); transform: translateY(-1px); text-decoration: none; }

/* ---------- Document sheet ---------- */
.content {
    max-width: 840px;
    margin: 32px auto 72px;
    padding: 0 16px;
}
.sheet {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    padding: 52px clamp(22px, 5vw, 64px);
}

.doc-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.82rem; font-weight: 700; color: var(--brand-700);
    background: var(--brand-050); border: 1px solid var(--brand-100);
    padding: 6px 14px; border-radius: var(--r-pill);
    margin-bottom: 18px;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; margin-bottom: 12px; color: var(--ink); }
html[lang="ar"] h1 { letter-spacing: 0; line-height: 1.3; }
.last-updated { color: var(--ink-faint); font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; }
.sheet > .lang-content > section:first-of-type { margin-top: 30px; }

h2 {
    font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -0.015em; line-height: 1.3;
    margin-bottom: 12px; padding-inline-start: 16px; position: relative;
}
h2::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 4px; bottom: 4px;
    width: 4px; border-radius: var(--r-pill); background: var(--brand-grad);
}
h3 { font-size: 1.08rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

section { margin-bottom: 32px; }
p { color: var(--ink-soft); margin-bottom: 12px; }
ul, ol { color: var(--ink-soft); padding-inline-start: 22px; margin-bottom: 12px; }
li { margin-bottom: 8px; }
li::marker { color: var(--brand); }
strong { color: var(--ink); font-weight: 700; }

/* Callout + step cards (delete-account) */
.warning {
    background: var(--warn-tint); border: 1px solid var(--warn-line);
    border-radius: var(--r-md); padding: 20px 22px; margin: 24px 0;
}
.warning h3 { color: var(--warn-ink); }
.warning p { color: var(--warn-ink); margin-bottom: 0; }
.warning strong { color: inherit; }
.step {
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 12px;
}
.step h3 { color: var(--brand-700); margin-bottom: 4px; }
.step p { margin-bottom: 0; }

.doc-footer {
    margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
    color: var(--ink-faint); font-size: 0.95rem;
}
.doc-footer p { color: var(--ink-faint); margin-bottom: 6px; }

@media (max-width: 600px) {
    .back-home span { display: none; }
    .back-home { width: 40px; padding: 0; justify-content: center; }
    .lang-toggle span { display: none; }
    .lang-toggle { width: 40px; padding: 0; justify-content: center; }
    .brand img { height: 24px; }
    .sheet { padding: 32px 20px; border-radius: var(--r-lg); }
    .content { margin: 20px auto 48px; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Dark mode: the token swap is in tokens.css; the static pages also switch the UA colour scheme. ---------- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { color-scheme: dark; }
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
