/* Clipsavo v3 — shared styles */
:root {
  --paper: #F3F5FB;
  --surface: #FFFFFF;
  --surface-2: #F7F8FD;
  --ink: #11162E;
  --muted: #5C6585;
  --line: #E0E4F1;
  --brand: #3346FF;
  --brand-deep: #1C27C9;
  --brand-ink: #FFFFFF;
  --brand-soft: #E9ECFF;
  --amber: #FFB020;
  --amber-soft: #FFF3D9;
  --ok: #128A4E;
  --err: #C62B2B;
  --err-soft: #FDECEC;
  --hero-1: #2333E6;
  --hero-2: #3346FF;
  --radius-lg: 22px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 22, 46, .05), 0 24px 48px -28px rgba(17, 22, 46, .35);
  --shadow-sm: 0 1px 2px rgba(17, 22, 46, .06), 0 6px 16px -10px rgba(17, 22, 46, .22);
  color-scheme: light;
}
/* dark: chosen explicitly, or following the system when nothing is chosen */
:root[data-theme="dark"] {
  --paper: #0C1021; --surface: #151A30; --surface-2: #11162A; --ink: #ECEFFB; --muted: #9AA3C4; --line: #252C49;
  --brand: #7482FF; --brand-deep: #5462F5; --brand-ink: #0C1021; --brand-soft: #1D2448;
  --amber: #FFC14D; --amber-soft: #2E2612; --ok: #3CCB82; --err: #FF7A70; --err-soft: #2A1517;
  --hero-1: #141B4D; --hero-2: #1F2A78;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 24px 48px -28px rgba(0,0,0,.8);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -10px rgba(0,0,0,.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1021; --surface: #151A30; --surface-2: #11162A; --ink: #ECEFFB; --muted: #9AA3C4; --line: #252C49;
    --brand: #7482FF; --brand-deep: #5462F5; --brand-ink: #0C1021; --brand-soft: #1D2448;
    --amber: #FFC14D; --amber-soft: #2E2612; --ok: #3CCB82; --err: #FF7A70; --err-soft: #2A1517;
    --hero-1: #141B4D; --hero-2: #1F2A78;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 24px 48px -28px rgba(0,0,0,.8);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -10px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Alexandria", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.65;
}
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 16px; position: relative; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; display: block; box-shadow: var(--shadow-sm); }
.on-hero .brand { color: #fff; }
.tools { display: flex; gap: 8px; align-items: center; }
.icon-btn, .lang > summary {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none;
}
.lang > summary::-webkit-details-marker { display: none; }
.on-hero .icon-btn, .on-hero .lang > summary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; }
.icon-btn:hover, .lang > summary:hover { border-color: var(--brand); }
.on-hero .icon-btn:hover, .on-hero .lang > summary:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }
.icon-btn.primary { background: var(--amber); border-color: var(--amber); color: #11162E; }
.icon-btn[hidden] { display: none; }
.theme-btn .sun { display: none; }
:root[data-theme-now="dark"] .theme-btn .sun { display: block; }
:root[data-theme-now="dark"] .theme-btn .moon { display: none; }

.lang { position: relative; }
.lang .code { letter-spacing: .02em; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 20;
}
.lang-menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; text-align: start;
}
.lang-menu button:hover { background: var(--brand-soft); }
.lang-menu button small { color: var(--muted); font-size: 12px; }
.lang-menu button[aria-current="true"] { font-weight: 700; }
.lang-menu button[aria-current="true"]::after { content: "✓"; color: var(--brand); }

/* ---------- footer ---------- */
footer { margin-top: 80px; background: var(--surface); border-top: 1px solid var(--line); }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding-top: 36px; padding-bottom: 36px; }
footer .about { color: var(--muted); font-size: 14px; max-width: 42ch; margin: 10px 0 0; }
footer nav { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
footer nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
footer nav a:hover { color: var(--ink); }
footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13px; }

/* ---------- shared hero band (home + inner pages) ---------- */
.hero-band {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 85% -10%, rgba(255,255,255,.18), transparent 55%), linear-gradient(160deg, var(--hero-1), var(--hero-2));
  border-radius: 0 0 40px 40px; padding-bottom: 44px;
}
.hero-band .motif { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .16; }

/* ---------- legal pages ---------- */
.page-hero { padding-bottom: 112px; }
.page-head { position: relative; max-width: 800px; margin: 0 auto; padding-top: 18px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.legal-tabs a {
  padding: 6px 14px; border-radius: 999px; font-size: 14px; text-decoration: none;
  color: rgba(255,255,255,.92); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
}
.legal-tabs a:hover { background: rgba(255,255,255,.2); }
.legal-tabs a[aria-current="page"] { background: #fff; color: #1C27C9; border-color: #fff; font-weight: 700; }
.page-head h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.15; font-weight: 800; letter-spacing: -.025em; margin: 0 0 8px; }
html[lang="ar"] .page-head h1 { letter-spacing: 0; line-height: 1.35; }
.page-head .updated { color: rgba(255,255,255,.78); margin: 0; font-size: 15px; }

.doc {
  position: relative; max-width: 800px; margin: -76px auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 26px; padding: 40px 40px 34px; box-shadow: var(--shadow);
}
.doc > div > p:first-child { font-size: 18px; color: var(--ink); margin-top: 0; }
.doc p { color: var(--muted); }
.doc h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 34px 0 10px; color: var(--ink); }
.doc h2::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--amber); flex: none; }
.doc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc li {
  position: relative; padding: 12px 16px; padding-inline-start: 42px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
}
.doc li::before {
  content: ""; position: absolute; inset-inline-start: 16px; top: 1.15em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.contact-box {
  display: flex; align-items: center; gap: 14px; margin-top: 34px; padding: 18px 20px; border-radius: 18px;
  background: var(--brand-soft); color: var(--ink);
}
.contact-box .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); flex: none; }
.contact-box strong { display: block; }
.contact-box a { font-weight: 600; direction: ltr; unicode-bidi: isolate; }

[data-l]:not(.on) { display: none !important; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 640px) {
  .doc { padding: 26px 18px; margin-top: -64px; border-radius: 22px; }
  .page-hero { padding-bottom: 92px; border-radius: 0 0 28px 28px; }
  .legal-tabs a { font-size: 13px; padding: 5px 12px; }
  .doc li { padding: 10px 12px; padding-inline-start: 36px; }
  .doc li::before { inset-inline-start: 13px; }
  footer .wrap { grid-template-columns: 1fr; }
  .brand { font-size: 19px; }
}
