/* ============================================================
   site.css — the public pages' shared layer (owner, 2026-11-01)
   ============================================================
   Loaded before each page's own <style>, by the home, /agents, the legal
   pages and the blog. It holds what must be the same everywhere: the colours,
   the logo, the one button with its one hover, the footer, the icons.

   Type scale: multiples of 4 only, 48px at most (12 · 16 · 20 · 24 · 28 · 32 ·
   36 · 48). tests/test_site_design.py checks every page's CSS for it.

   The owner's palette (2026-11-01): #030811 #E49E49 #112B58 #488079 #FFFFFF.
   One orange. What sits on it is near black (--on-signal, 8.9:1; white would be
   2.3:1), and a button under the pointer turns white, not a second orange. Small
   teal text is a tint (--good, --signal2-ink): #488079 on a card is 3.3:1. Cards keep
   their earlier navy, the owner's call over #112B58.

   Light and dark (owner, 2026-11-28; dark only from 2026-11-01 until then): the
   device decides until the visitor presses the switch beside the logo
   (.theme-toggle, also in the footer; /static/theme.js), and the choice is kept («ah_site_theme»,
   set on <html data-theme> by the first line of each page's <head>). Light is
   the console's white theme (dashboard/assets/tokens.css): one orange still,
   on buttons, bars and borders, but orange as text is navy there (--signal-text),
   since orange on white reads 2.3:1. The two light blocks below are the same
   set: one for a device that prefers light, one for the visitor's choice.
   Sign-in and sign-up stay dark; the console keeps its own setting.
   tests/test_site_design.py and tests/test_palette.py hold all this.
   ============================================================ */
:root {
  color-scheme: dark;
  --page:#030811; --surface:#0F1B2E; --card:#142743; --border:#223A5E;
  --strong:#FFFFFF; --text:#D6DEEA; --muted:#A9B5C9;
  --signal:#E49E49; --on-signal:#030811; --signal-text:#E49E49;
  --signal2:#488079; --on-signal2:#FFFFFF; --signal2-ink:#7FB3AB;
  --neutral-fill:#475569; --on-neutral:#FFFFFF;
  --good:#7FB3AB; --bad:#EF5B5B; --bad-ink:#FF9A9A; --blue:#A9B9D6; --blue-ink:#A9B9D6;
  --logo:#FFFFFF;
  --nav-bg:rgba(3,8,17,.92); --line-soft:rgba(34,58,94,.5); --row-hover:rgba(255,255,255,.02);
  --hero-glow:rgba(228,158,73,.10); --hero-glow-2:rgba(72,128,121,.10);
  --shadow-card:0 30px 70px rgba(3,8,17,.5); --shadow-mock:0 22px 50px rgba(3,8,17,.45);
  --h1:48px; --h2:36px; --h3:32px;
  --ic-tick:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22m5 14l3.5 3.5L19 6.5%22/%3E%3C/svg%3E"); --ic-cancel:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M18 6L6 18m12 0L6 6%22/%3E%3C/svg%3E"); --ic-plus:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M12 4v16m8-8H4%22/%3E%3C/svg%3E");
}
@media (max-width:820px) { :root { --h1:36px; --h2:28px; --h3:24px; } }

/* ── Light: a device that prefers it, unless the visitor chose dark ── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page:#F4F6FA; --surface:#FFFFFF; --card:#EDF0F5; --border:#DCE0E8;
    --strong:#030811; --text:#26344F; --muted:#4A5A78;
    --signal:#E49E49; --on-signal:#030811; --signal-text:#112B58;
    --signal2:#488079; --on-signal2:#FFFFFF; --signal2-ink:#3F7069;
    --neutral-fill:#475569; --on-neutral:#FFFFFF;
    --good:#3F7069; --bad:#DC2626; --bad-ink:#B91C1C; --blue:#112B58; --blue-ink:#112B58;
    --logo:#030811;
    --nav-bg:rgba(255,255,255,.92); --line-soft:rgba(220,224,232,.7); --row-hover:rgba(3,8,17,.03);
    --hero-glow:rgba(228,158,73,.16); --hero-glow-2:rgba(72,128,121,.12);
    --shadow-card:0 20px 50px rgba(3,8,17,.10); --shadow-mock:0 16px 40px rgba(3,8,17,.12);
  }
}
/* ── Light: the visitor's choice (the same set) ── */
:root[data-theme="light"] {
  color-scheme: light;
  --page:#F4F6FA; --surface:#FFFFFF; --card:#EDF0F5; --border:#DCE0E8;
  --strong:#030811; --text:#26344F; --muted:#4A5A78;
  --signal:#E49E49; --on-signal:#030811; --signal-text:#112B58;
  --signal2:#488079; --on-signal2:#FFFFFF; --signal2-ink:#3F7069;
  --neutral-fill:#475569; --on-neutral:#FFFFFF;
  --good:#3F7069; --bad:#DC2626; --bad-ink:#B91C1C; --blue:#112B58; --blue-ink:#112B58;
  --logo:#030811;
  --nav-bg:rgba(255,255,255,.92); --line-soft:rgba(220,224,232,.7); --row-hover:rgba(3,8,17,.03);
  --hero-glow:rgba(228,158,73,.16); --hero-glow-2:rgba(72,128,121,.12);
  --shadow-card:0 20px 50px rgba(3,8,17,.10); --shadow-mock:0 16px 40px rgba(3,8,17,.12);
}

/* ── The switch in the top bar: the sun while dark (press for light), the moon while light ── */
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; flex:none; width:40px; height:40px; padding:0;
  border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--strong); font-size:20px; cursor:pointer;
  transition:border-color .16s ease; }
.theme-toggle:hover { border-color:var(--signal); }
.theme-toggle:focus-visible { outline:2px solid var(--signal); outline-offset:2px; }
.theme-toggle .ic-moon { display:none; }
:root[data-theme="light"] .theme-toggle .ic-sun { display:none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display:inline-block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .ic-sun { display:none; }
  :root:not([data-theme="dark"]) .theme-toggle .ic-moon { display:inline-block; }
}
/* The footer's switch (.sf-theme) is one of the footer's links, with its words: a second way to it. */
.sf-col .theme-toggle { width:auto; height:auto; gap:8px; padding:0; border:0; border-radius:0;
  font-family:inherit; font-size:16px; font-weight:inherit; line-height:24px; color:var(--text); transition:color .16s ease; }
.sf-col .theme-toggle .ic { font-size:16px; color:var(--muted); }
.sf-col .theme-toggle:hover { color:var(--signal-text); }
.sf-col .theme-toggle:hover .ic { color:inherit; }
/* In the top bar the switch sits beside the logo (owner, 2026-11-28: «جمب كلمة AqarHawk»): .nav-start holds
   the two, and takes the place the logo had. On a phone both are smaller so the bar keeps its one line. */
nav .nav-start { display:flex; align-items:center; gap:8px; flex:none; }
@media (max-width:480px) {
  nav .nav-start { gap:4px; }
  nav .theme-toggle { width:32px; height:32px; font-size:16px; border-color:transparent; }
}
/* The switch took 36px of a phone's bar: the wordmark and the spacing give them back, so the logo, the
   language, sign-in and the offer all stay on the one row. */
@media (max-width:440px) {
  nav .brand { gap:4px; }
  nav .brand .logo { font-size:16px; }
  nav .nav-links a.nav-ghost, nav .nav-links a.nav-cta { padding:8px; }
}
@media (max-width:370px) {
  html body > nav { gap:4px; }                      /* over the pages' own body > nav */
  nav .theme-toggle { width:28px; }
}
@media (max-width:340px) {
  /* Sign-in stays in the hero and the footer: this row cannot hold it next to the offer. */
  html body > nav .nav-links a.nav-ghost { display:none; }
}

/* ── Icons: Hugeicons, /static/assets/icons.svg, one set for the site and the console ── */
.ic { width:1em; height:1em; display:inline-block; vertical-align:-.15em; flex:none; }

/* A pseudo-element as an icon, in its own colour (a tick in a list). */
.mark-tick::before, .mark-cancel::before { content:''; flex:none; display:inline-block; width:16px; height:16px;
  background:currentColor; -webkit-mask:var(--ic-tick) center/contain no-repeat; mask:var(--ic-tick) center/contain no-repeat; }

/* ── The logo: white, no tile. ── */
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; }
.brand-mark { display:block; width:44px; height:40px; flex:none; background:var(--logo);
  -webkit-mask:url(/static/assets/logo-mark.png) center/contain no-repeat;
  mask:url(/static/assets/logo-mark.png) center/contain no-repeat; }

/* ── One button, two looks at rest, ONE look on hover: whichever it was, a
      button under the pointer lifts and turns white. ── */
.btn-primary, .btn-ghost, .btn, .contact-form button, .nav-links a.nav-cta, .nav-links a.nav-ghost {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:48px; padding:12px 28px; border:1px solid transparent; border-radius:8px;
  font-family:inherit; font-size:16px; font-weight:600; line-height:24px; text-decoration:none; white-space:nowrap; cursor:pointer;
  transition:background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.nav-links a.nav-cta, .nav-links a.nav-ghost { min-height:40px; padding:8px 16px; }
.btn-primary, .contact-form button, .nav-links a.nav-cta { background:var(--signal); color:var(--on-signal); }
.btn-ghost, .nav-links a.nav-ghost { background:transparent; border-color:var(--border); color:var(--strong); }
.btn-primary:hover, .btn-ghost:hover, .btn:hover, .contact-form button:hover,
.nav-links a.nav-cta:hover, .nav-links a.nav-ghost:hover {
  background:var(--strong); border-color:var(--strong); color:var(--page);
  transform:translateY(-1px); box-shadow:0 8px 20px -8px rgba(255,255,255,.35); }
.btn-primary:active, .btn-ghost:active, .btn:active, .contact-form button:active,
.nav-links a.nav-cta:active, .nav-links a.nav-ghost:active { transform:none; box-shadow:none; }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .btn:focus-visible, .contact-form button:focus-visible,
.nav-links a.nav-cta:focus-visible, .nav-links a.nav-ghost:focus-visible { outline:2px solid var(--signal); outline-offset:2px; }

/* ── The footer: the same on every public page ── */
.site-footer { border-top:1px solid var(--border); padding:48px; color:var(--muted); }
.sf-grid { max-width:1180px; margin:0 auto; display:grid; grid-template-columns:1.4fr 1fr 1fr 1.2fr; gap:32px; }
.sf-brand { align-self:start; }
.sf-col { display:flex; flex-direction:column; align-items:flex-start; gap:12px; }
.sf-h { font-size:12px; font-weight:600; line-height:16px; color:var(--muted); }
.sf-col a { display:inline-flex; align-items:center; gap:8px; color:var(--text); font-size:16px; line-height:24px; text-decoration:none; transition:color .16s ease; }
.sf-col a:hover { color:var(--signal-text); }
.sf-col a .ic { font-size:16px; color:var(--muted); transition:color .16s ease; }
.sf-col a:hover .ic { color:inherit; }
.sf-copy { grid-column:1 / -1; border-top:1px solid var(--border); padding-top:24px; padding-inline-end:88px; /* the chat bubble */
  font-size:12px; line-height:20px; color:var(--muted); }
@media (max-width:820px) {
  .site-footer { padding:32px 16px 96px; }
  .sf-grid { grid-template-columns:1fr 1fr; gap:32px 16px; }
  .sf-brand { grid-column:1 / -1; }
  .sf-copy { padding-inline-end:0; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover, .btn-ghost:hover, .btn:hover, .contact-form button:hover,
  .nav-links a.nav-cta:hover, .nav-links a.nav-ghost:hover { transform:none; }
}
