/* qabas.mtalagi.com — one stylesheet, no build step.
 *
 * THE PALETTE IS THE APP'S, lifted verbatim from lib/models/app_colors.dart so
 * somebody arriving from the store listing recognises the same product. Dark is
 * the default because the app opens dark.
 *
 * NO FRAMEWORK AND NO BUNDLER, deliberately: the whole site has to survive a VPS
 * move by being copied, and a build toolchain is one more thing to reinstall and
 * get wrong at the worst moment. Six pages do not need one.
 */

:root {
  /* Dark — the default. AppColors.dark* */
  --bg: #0d1919;
  --surface: #182425;
  --surface-2: #1e2c2d;
  --accent: #53c15b;
  --accent-ink: #0d1919;
  --text: #eeede1;
  --muted: #7c8880;
  --line: rgba(238, 237, 225, 0.12);

  /* Role colours — AppColors.tutorPFP / studentPFP / guardianPFP, lightened
     for legibility on a dark ground. The app uses them for avatars; here they
     separate the three audiences on the overview page. */
  --role-student: #d98b2b;
  --role-tutor: #4caf50;
  --role-guardian: #4b9fe1;

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1080px;

  --font: "Ubuntu", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-ar: "Noto Kufi Arabic", "Segoe UI", "Tahoma", system-ui, sans-serif;

  color-scheme: dark;
}

:root[data-theme="light"] {
  /* AppColors.light* */
  --bg: #f2f4ee;
  --surface: #fafaf7;
  --surface-2: #eceee7;
  --accent: #2aad59;
  --accent-ink: #ffffff;
  --text: #252a26;
  --muted: #838881;
  --line: rgba(37, 42, 38, 0.12);

  --role-student: #9f5804;
  --role-tutor: #0c5501;
  --role-guardian: #014e98;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body { font-family: var(--font-ar); }

/* Logical properties throughout, so RTL mirrors without a second stylesheet. */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- header */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
/* THE APP'S OWN MARK, not a tinted square with a letter in it. It is the same
   file the app ships (`assets/images/logo.png`), so somebody arriving from the
   store recognises it — and it carries its own colour, so it needs no
   background here and reads on both themes unchanged. */
.brand .mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

nav.site { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
nav.site a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 14px;
}
nav.site a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
nav.site a[aria-current="page"] { color: var(--accent); }

.iconbtn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.iconbtn:hover { border-color: var(--accent); }

/* Only the nav links collapse on small screens; the theme and language
   controls stay, because they are the two things a visitor may need first. */
@media (max-width: 720px) {
  nav.site a { display: none; }
  nav.site a.always { display: inline-block; }
}

/* ------------------------------------------------------------------ hero */

.hero { padding: 72px 0 56px; }
.hero h1 {
  font-size: clamp(30px, 6vw, 50px);
  line-height: 1.15;
  margin: 0 0 16px;
  text-wrap: balance;
}
.hero p.sub {
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 30px;
}

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 15px;
}
.store:hover { text-decoration: none; filter: brightness(1.06); }
.store.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------- content */

section.band { padding: 54px 0; border-top: 1px solid var(--line); }
section.band h2 { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 10px; text-wrap: balance; }
section.band > .wrap > p.lede { color: var(--muted); max-width: 62ch; margin: 0 0 30px; }

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* The role cards carry a stripe rather than a tinted background: three tinted
   panels side by side fight each other, one stripe each reads as a set. */
.card.role { border-top: 3px solid var(--r, var(--accent)); }
.card.role .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--r, var(--accent));
  margin-bottom: 8px;
}
.card.role ul { margin: 12px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 14.5px; }
.card.role li { margin-bottom: 5px; }

/* ------------------------------------------------------------ legal pages */

article.doc { padding: 44px 0 72px; }
article.doc h1 { font-size: clamp(26px, 4.5vw, 38px); margin: 0 0 6px; }
article.doc .version {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 28px;
}
article.doc .body { max-width: 72ch; }
article.doc h2 {
  font-size: 19px;
  margin: 34px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}
article.doc p { margin: 0 0 14px; }
article.doc p.lead { color: var(--muted); font-size: 16.5px; }
article.doc ul { margin: 0 0 14px; padding-inline-start: 20px; }
article.doc li { margin-bottom: 8px; }
article.doc strong { color: var(--text); font-weight: 650; }

/* ------------------------------------------------------------------ steps */

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; max-width: 72ch; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 48px;
  margin-bottom: 22px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
}
ol.steps h3 { margin: 4px 0 4px; font-size: 16.5px; }
ol.steps p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ------------------------------------------------------------------ forms */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 520px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  /* An email address and a password are never Arabic; the app forces the same
     direction on its own fields for the same reason. */
  direction: ltr;
  text-align: start;
}
.field input:focus { border-color: var(--accent); outline: none; }

button.primary {
  width: 100%;
  padding: 13px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
button.primary:disabled { opacity: .55; cursor: not-allowed; }

button.danger { background: #d64a4a; color: #fff; }

.msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}
.msg.show { display: block; }
.msg.ok { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.msg.bad { background: rgba(214, 74, 74, .16); color: #ff9a9a; }
:root[data-theme="light"] .msg.bad { color: #a52020; }

.callout {
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 22px 0;
  max-width: 72ch;
}
.callout.warn { border-inline-start-color: #d64a4a; }
.callout p { margin: 0; font-size: 14.5px; }
.callout p + p { margin-top: 8px; }

/* ----------------------------------------------------------------- footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 34px 0 46px;
  color: var(--muted);
  font-size: 14px;
}
footer.site .cols { display: flex; flex-wrap: wrap; gap: 26px; margin-bottom: 18px; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }

/* Wide content must scroll inside itself rather than the page. */
.scroll-x { overflow-x: auto; }

/* ----------------------------------------------------- screenshot steps */

/* THE PICTURES ARE CONFIRMATION, NOT THE CONTENT. They shipped at ~230px wide,
   which on a 1:2 phone screenshot is ~470px tall — six of those made the
   walkthrough a page of images with captions rather than instructions with
   illustrations. They are a quarter of that linear size now.

   EVERY BOX IS THE SAME FIXED SIZE, not a percentage. All six source files are
   re-encoded to one canvas by tool/make_site_shots.py, so nothing here has to
   cope with a ragged set, the layout cannot shift as images arrive, and a
   narrow screen gets the same thumbnail a wide one does. */
ol.steps.shots > li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
}

.shot {
  margin: 0;
  flex: 0 0 auto;      /* never stretches, never shrinks */
  width: 112px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.shot img {
  display: block;
  width: 112px;
  height: 226px;       /* stated, so no reflow when it loads */
}

/* The caption was a second label for something the step title already names.
   At this size it also doubled the height of the thumbnail. */
.shot figcaption { display: none; }

.steps.shots .said { flex: 1 1 auto; min-width: 0; }

/* Below ~560px the text column gets too narrow beside even a 112px image, so
   the picture drops under it — still at exactly the same size. */
@media (max-width: 560px) {
  ol.steps.shots > li { flex-wrap: wrap; }
  .steps.shots .said { flex: 1 1 100%; }
}

/* Said once, near the images rather than in a footnote: these were taken
   before the current redesign, so the layout differs from what is on screen
   today even though the path does not. */
.shots-note {
  font-size: 13px;
  color: var(--muted);
  border-inline-start: 3px solid var(--line);
  padding-inline-start: 12px;
  margin: 0 0 28px;
  max-width: 72ch;
}
