/* ZAGoldFlow public pages — palette mirrors lib/src/core/theme/app_colors.dart */
@font-face { font-family: "Cairo"; font-weight: 400; font-display: swap; src: url("fonts/cairo-regular.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-weight: 600; font-display: swap; src: url("fonts/cairo-semibold.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-weight: 700; font-display: swap; src: url("fonts/cairo-bold.woff2") format("woff2"); }
@font-face { font-family: "Cairo"; font-weight: 800; font-display: swap; src: url("fonts/cairo-extrabold.woff2") format("woff2"); }

:root {
  --night: #1e1a16;        /* splashDark */
  --night-deep: #120e09;
  --ink: #2a211a;          /* textPrimary */
  --muted: #7d6e5b;        /* textSecondary, darkened for AA on paper */
  --gold: #d4af37;         /* primaryGold */
  --gold-bright: #f0c94a;  /* accentGoldLight */
  --gold-deep: #996515;    /* deepGold */
  --gold-cta: #dba50d;     /* accentCta */
  --paper: #faf6ee;        /* champagne */
  --paper-2: #f5ecd4;      /* softGold */
  --line: #e8dcc0;
  --surface: #fffdf8;
  --ok: #2e7d4f;
  --bar: linear-gradient(160deg, #fff1b8 0%, #f0c94a 18%, #d4af37 42%, #b8860b 64%, #e5b93c 82%, #fff1b8 100%);
  --radius-s: 10px;
  --radius-l: 22px;
  --measure: 66ch;
  --step-0: clamp(1rem, .96rem + .2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + .45vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5ecd4; --muted: #b8a77a; --paper: #14100b; --paper-2: #1d1710;
    --line: #2a2418; --surface: #1a150e; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.85 "Cairo", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--gold-deep); text-decoration: none; background: linear-gradient(currentColor 0 0) 0 100% / 0 1.5px no-repeat; transition: background-size .25s ease; }
a:hover { background-size: 100% 1.5px; }
@media (prefers-color-scheme: dark) { a { color: var(--gold-bright); } }
:focus-visible { outline: 2px solid var(--gold-cta); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--gold); color: var(--night); padding: .5rem 1rem; border-radius: 8px; z-index: 10; }
.skip:focus { top: 1rem; }

/* language switching: both languages ship in the HTML for crawlers; JS shows one */
html[lang="ar"] [data-l="en"], html[lang="en"] [data-l="ar"] { display: none !important; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(212, 175, 55, .14);
  transition: box-shadow .3s ease;
}
.top.is-scrolled { box-shadow: 0 10px 30px -18px rgba(0,0,0,.7); }
.top__in { max-width: 1180px; margin: auto; padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #f5ecd4; background: none; font-weight: 800; letter-spacing: .01em; }
.brand img { width: 42px; height: 42px; filter: drop-shadow(0 2px 8px rgba(240, 201, 74, .35)); }
.brand span { font-size: 1.12rem; }
.nav { display: flex; gap: .25rem; margin-inline-start: auto; }
.nav a {
  color: #d9ccb0; background: none; padding: .35rem .8rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: #fff3cf; background: rgba(212, 175, 55, .1); }
.nav a[aria-current="page"] { color: var(--night); background: var(--bar); }
.lang {
  display: inline-flex; border: 1px solid rgba(212, 175, 55, .35); border-radius: 999px; padding: 3px; gap: 2px;
}
.lang button {
  font: 600 .85rem "Cairo", sans-serif; color: #d9ccb0; background: none; border: 0; padding: .2rem .7rem; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: rgba(212, 175, 55, .22); color: #fff3cf; }
.menu { display: none; margin-inline-start: auto; background: none; border: 1px solid rgba(212,175,55,.35); color: #f5ecd4; border-radius: 10px; padding: .35rem .6rem; font: 600 .9rem "Cairo"; }

@media (max-width: 860px) {
  .menu { display: inline-block; }
  .nav {
    position: absolute; inset-inline: 0; top: 100%; flex-direction: column; gap: 0; padding: .5rem 1rem 1rem;
    background: var(--night); border-bottom: 1px solid rgba(212,175,55,.2);
    clip-path: inset(0 0 100% 0); transition: clip-path .35s cubic-bezier(.2,.7,.2,1);
  }
  .nav.is-open { clip-path: inset(0 0 0 0); }
  .nav a { padding: .7rem .8rem; border-radius: 10px; }
  .lang { margin-inline-start: .5rem; }
}

/* ---------- hero: the gold bar ---------- */
.hero {
  position: relative; overflow: hidden; color: #f5ecd4;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(240, 201, 74, .16), transparent 70%),
    radial-gradient(40% 60% at 85% 100%, rgba(153, 101, 21, .25), transparent 70%),
    linear-gradient(180deg, var(--night), var(--night-deep));
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem clamp(3rem, 7vw, 5rem);
}
.hero__in { max-width: 1180px; margin: auto; display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); align-items: center; }
.hero h1 { font-size: var(--step-3); line-height: 1.25; font-weight: 800; margin: 0 0 .75rem; color: #fff6dc; text-wrap: balance; }
.hero p { color: #cfc2a5; margin: 0; max-width: 46ch; font-size: var(--step-1); line-height: 1.7; }
.hero .meta { margin-top: 1.25rem; color: #a99a7c; font-size: .92rem; }
@media (max-width: 860px) { .hero__in { grid-template-columns: 1fr; } .bar-wrap { order: -1; } }

.bar-wrap { perspective: 900px; display: grid; place-items: center; }
.bar {
  position: relative; width: min(100%, 420px); aspect-ratio: 1.9;
  clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%);
  background: var(--bar); border-radius: 6px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), inset 0 -10px 24px rgba(120, 72, 6, .45);
  transform: rotateX(18deg);
  display: grid; place-items: center; text-align: center; color: #5a3d07;
}
.bar::before { /* engraved plate */
  content: ""; position: absolute; inset: 14% 17% 16%;
  border-radius: 6px;
  box-shadow: inset 0 2px 3px rgba(110, 68, 4, .55), inset 0 -1px 0 rgba(255, 244, 200, .8), 0 1px 0 rgba(255, 244, 200, .6);
}
.bar::after { /* light sweep */
  content: ""; position: absolute; inset: -20% auto -20% -40%; width: 35%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-18deg); opacity: 0;
}
.bar__mark { position: relative; display: grid; gap: .1rem; padding: 0 22%; }
.bar__mark img { width: 46px; height: 46px; margin: 0 auto .15rem; filter: sepia(1) saturate(2) brightness(.55) contrast(1.4); mix-blend-mode: multiply; opacity: .8; }
.bar__title { font-weight: 800; font-size: clamp(1.05rem, .9rem + .8vw, 1.45rem); line-height: 1.25; text-shadow: 0 1px 0 rgba(255, 244, 200, .9), 0 -1px 0 rgba(110, 68, 4, .35); }
.bar__fine { font-weight: 700; font-size: .78rem; letter-spacing: .08em; opacity: .85; text-shadow: 0 1px 0 rgba(255, 244, 200, .8); }
.bar-shadow { width: 70%; height: 22px; margin-top: -6px; background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.6), transparent); filter: blur(4px); }

/* the one orchestrated moment: the bar is cast, settles, and catches the light once */
@media (prefers-reduced-motion: no-preference) {
  .js .bar { animation: cast 1.1s cubic-bezier(.16, .9, .3, 1.05) both .15s; }
  .js .bar::after { animation: sweep 1.4s ease-in-out 1.2s both; }
  .js .bar:hover::after { animation: sweep 1.1s ease-in-out both; }
  .js .bar-shadow { animation: shade 1.1s ease both .15s; }
  .js .hero h1, .js .hero p, .js .hero .meta { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
  .js .hero p { animation-delay: .12s; } .js .hero .meta { animation-delay: .22s; }
  .dust { position: absolute; inset: 0; pointer-events: none; }
}
@keyframes cast { from { opacity: 0; transform: rotateX(55deg) translateY(-40px) scale(.92); } to { opacity: 1; transform: rotateX(18deg); } }
@keyframes shade { from { opacity: 0; transform: scaleX(.4); } to { opacity: 1; transform: none; } }
@keyframes sweep { 0% { left: -40%; opacity: 0; } 15% { opacity: 1; } 100% { left: 120%; opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dust { display: none; } html { scroll-behavior: auto; } }

/* ---------- document body ---------- */
.doc { max-width: 1180px; margin: auto; padding: clamp(2rem, 5vw, 3.5rem) 1.25rem 4rem; display: grid; gap: 3rem; grid-template-columns: 220px minmax(0, var(--measure)); justify-content: center; }
.doc--plain { grid-template-columns: minmax(0, 760px); }
@media (max-width: 960px) { .doc { grid-template-columns: minmax(0, var(--measure)); } .toc { display: none; } }

.toc { position: sticky; top: 96px; align-self: start; font-size: .92rem; }
.toc h2 { font-size: .95rem; margin: 0 0 .6rem; color: var(--muted); font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.toc a { display: block; padding: .3rem .9rem; color: var(--muted); background: none; margin-inline-start: -2px; border-inline-start: 2px solid transparent; transition: color .2s, border-color .2s; }
.toc a:hover, .toc a.is-active { color: var(--ink); border-inline-start-color: var(--gold); }

.prose h2 { font-size: var(--step-2); line-height: 1.35; margin: 2.6rem 0 .6rem; font-weight: 800; }
.prose h2:first-child { margin-top: 0; }
.prose h2 .n { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-inline-end: .55rem; border-radius: 50%; font-size: .62em; color: #5a3d07; background: var(--bar); vertical-align: .18em; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.prose p, .prose ul { margin: 0 0 1rem; }
.prose ul { padding-inline-start: 1.2rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--gold); }
.prose strong { font-weight: 700; }
.lead { font-size: var(--step-1); line-height: 1.75; color: var(--ink); }
.note {
  border-inline-start: 3px solid var(--gold); background: var(--paper-2); padding: 1rem 1.25rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 1.5rem 0;
}
html[dir="rtl"] .note { border-radius: var(--radius-s) 0 0 var(--radius-s); }

/* steps (delete page — a real sequence) */
.steps { list-style: none; padding: 0; margin: 1.25rem 0 2rem; counter-reset: s; display: grid; gap: 1rem; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 3.4rem; min-height: 2.6rem; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: .1rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #5a3d07; background: var(--bar); }

/* support page */
.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 0 0 3rem; }
.channel {
  display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.3rem; border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .2s, transform .2s;
}
.channel:hover { border-color: var(--gold); transform: translateY(-2px); background-size: 0; }
.channel svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--bar); color: #5a3d07; }
.channel b { display: block; font-size: 1.05rem; }
.channel b { line-height: 1.5; margin-bottom: .2rem; }
.channel .num { display: block; color: var(--muted); font-size: .95rem; direction: ltr; unicode-bidi: isolate; text-align: start; }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 0; font-weight: 700; font-size: var(--step-1); display: flex; gap: 1rem; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; border-inline-end: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform .3s ease; margin-top: -6px; }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: 6px; }
.faq .a { padding: 0 0 1.2rem; color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .faq details[open] .a { animation: rise .35s ease both; }
}

/* ---------- footer ---------- */
.foot { background: var(--night); color: #a99a7c; padding: 2.5rem 1.25rem; font-size: .93rem; }
.foot__in { max-width: 1180px; margin: auto; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.foot a { color: #e8d5a3; }
.foot .brand img { width: 34px; height: 34px; }
