/**
 * @file site.css
 * @brief Base styles of the ColocApp website: tokens from the app design
 *        system (lib/core/theme/app_colors.dart), fonts, header, footer,
 *        buttons, legal pages and 404. No script, no tracker.
 * @note Light theme = Apple blue (#0040DD) on iOS grey; dark theme = Grow
 *       orange (#FF991A) on iOS dark greys, exactly like the app.
 */
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/BricolageGrotesque-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/BricolageGrotesque-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/SpaceGrotesk-Medium.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F8F8F8;
  --ink: #000000;
  --muted: #5C6269;
  --line: #ECEEF3;
  --primary: #0040DD;
  --on-primary: #FFFFFF;
  --primary-container: #E6ECFC;
  --on-primary-container: #002A8F;
  --secondary: #C2410C;
  --secondary-container: #FFEDD5;
  --on-secondary-container: #7C2D12;
  --tertiary: #0F766E;
  --tertiary-container: #CCFBF1;
  --on-tertiary-container: #134E4A;
  --hero-bg: #0040DD;
  --hero-ink: #FFFFFF;
  --hero-muted: #E6ECFC;
  --hero-accent: #FFC94A;
  --blob-a: #86EFAC;
  --blob-b: #8CA9F0;
  --store-bg: #000000;
  --store-ink: #FFFFFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 32, 110, .10);
  --radius: 22px;
  --display: "Bricolage Grotesque", ui-rounded, -apple-system, "Segoe UI", sans-serif;
  --ui: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Arabic: the Latin brand fonts have no Arabic glyphs, so Arabic text
     falls back per glyph to the platform Arabic UI fonts (iOS/macOS,
     Android, Windows), Latin words keep the brand fonts. */
  --arabic: "SF Arabic", "Geeza Pro", "Noto Sans Arabic", "Noto Naskh Arabic", "Segoe UI", Tahoma, "Arial", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1C1E;
    --surface: #2C2C2E;
    --surface-2: #3A3A3C;
    --ink: #FFFFFF;
    --muted: #C9CBCD;
    --line: #48484A;
    --primary: #FF991A;
    --on-primary: #2B1700;
    --primary-container: #4A2A0A;
    --on-primary-container: #FFD8A8;
    --secondary: #94A3B8;
    --secondary-container: #334155;
    --on-secondary-container: #E2E8F0;
    --tertiary: #5EEAD4;
    --tertiary-container: #134E4A;
    --on-tertiary-container: #CCFBF1;
    --hero-bg: #1C1C1E;
    --hero-ink: #FFFFFF;
    --hero-muted: #C9CBCD;
    --hero-accent: #FF991A;
    --blob-a: #8A5A35;
    --blob-b: #2E6E62;
    --store-bg: #FFFFFF;
    --store-ink: #000000;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.6 var(--ui);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -.02em; margin: 0; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 20; }
.skip:focus { inset-inline-start: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* === Header === */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 21px/1 var(--display); letter-spacing: -.02em; margin-inline-end: auto; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
header.site nav { display: flex; gap: 4px; align-items: center; }
header.site nav a { color: var(--ink); text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: 10px; }
header.site nav a:hover { background: var(--surface); }
/* === Language menu (details/summary, no script needed) === */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--ink); white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { background: var(--surface); }
.lang-menu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 30; min-width: 170px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
header.site nav .lang-menu a { display: block; padding: 9px 12px; font-size: 15px; }
.lang-menu a[aria-current="page"] { font-weight: 700; color: var(--primary); }
.lang-menu a[lang="ar"] { font-family: var(--arabic); }

/* === One-time language suggestion (inserted by /assets/lang.js) === */
.lang-suggest { background: var(--primary-container); color: var(--on-primary-container); font-size: 15px; }
.lang-suggest .wrap { position: relative; display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding-block: 10px; padding-inline-end: 60px; }
.lang-suggest span { flex: 1 1 auto; }
.lang-suggest .close { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; font: 600 24px/1 var(--ui); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
.lang-suggest .close:hover { background: color-mix(in srgb, var(--on-primary-container) 12%, transparent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); text-decoration: none;
  font: 700 16px/1.2 var(--display); border: 0; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 15px; }
@media (max-width: 860px) { header.site nav .opt { display: none; } }
@media (max-width: 340px) { .brand span { display: none; } }

/* === Store buttons === */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding-block: 8px; padding-inline: 16px 20px; border-radius: 14px;
  background: var(--store-bg); color: var(--store-ink); text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .25);
  transition: transform .15s ease;
}
.store:hover { transform: translateY(-2px); }
.store svg { width: 28px; height: 28px; flex: none; fill: currentColor; }
.store small { display: block; font-size: 12px; line-height: 1.1; opacity: .85; }
.store strong { display: block; font: 700 19px/1.15 var(--display); }

/* === Footer === */
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; padding: 40px 0 48px; margin-top: 64px; }
footer.site .wrap { display: grid; gap: 24px; grid-template-columns: 1.4fr 1fr 1fr; }
footer.site h2 { font-size: 15px; color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--primary); }
footer.site .brand { margin-bottom: 12px; }
footer.site .langs ul { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer.site .langs { grid-column: 1 / -1; }
footer.site .langs a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: none; }
footer.site .copy { grid-column: 1 / -1; font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }
@media (max-width: 720px) { footer.site .wrap { grid-template-columns: 1fr 1fr; } footer.site .about { grid-column: 1 / -1; } }

/* === Document pages (legal, support, 404) === */
.doc { max-width: 760px; margin: 0 auto; padding: 40px 16px 0; }
.doc h1 { font-size: clamp(32px, 6vw, 44px); margin: 8px 0 12px; }
.doc h1, .doc h2, .legal h1 { overflow-wrap: break-word; hyphens: auto; }
.doc h2 { font-size: 22px; margin: 36px 0 10px; }
.doc h3 { font-size: 18px; margin: 24px 0 8px; }
.doc ul, .doc ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
.doc li { margin: 4px 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.meta { color: var(--muted); font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 20px 0; box-shadow: var(--shadow); }
.legal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px 16px; margin: 24px 0; }
.legal > h1:first-child { font-size: 26px; margin-top: 20px; }
.notice { background: var(--primary-container); color: var(--on-primary-container); border-radius: 14px; padding: 12px 16px; font-size: 15px; margin: 16px 0; }
.notice a { color: inherit; font-weight: 600; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-block: 4px; padding-inline: 44px 0; margin: 10px 0 !important; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-container); color: var(--on-primary-container); font: 700 15px/30px var(--display); text-align: center; }
.big-email { font: 700 clamp(19px, 5vw, 24px)/1.3 var(--display); word-break: break-word; }
.lost { text-align: center; padding-top: 72px; }
.lost .code { font: 800 clamp(80px, 22vw, 140px)/1 var(--display); color: var(--primary); letter-spacing: -.04em; }
.lost .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.nf[hidden] { display: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

/* === Arabic (dir="rtl") ===
   Layout mirrors through logical properties (inline-start/end) and the
   dir attribute; here only typography: Arabic script must not be
   letter-spaced (it breaks the joins) and needs taller lines. */
:lang(ar) { --display: "Bricolage Grotesque", var(--arabic); --ui: "Space Grotesk", var(--arabic); }
:lang(ar) body, body:lang(ar) { line-height: 1.75; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) .brand, :lang(ar) .eyebrow { letter-spacing: 0; line-height: 1.35; }
:lang(ar) .eyebrow { text-transform: none; font-size: 14px; }
