/* Self-hosted copies of the fonts used on arapskili.com (SIL Open Font License). */
@font-face{font-family:'Noto Naskh Arabic';font-style:normal;font-weight:400 700;font-display:swap;src:url(../fonts/app/noto-naskh-arabic.woff2) format('woff2');unicode-range:U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400 800;font-display:swap;src:url(../fonts/app/nunito-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400 800;font-display:swap;src:url(../fonts/app/nunito-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Playfair Display';font-style:italic;font-weight:500 600;font-display:swap;src:url(../fonts/app/playfair-italic-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Playfair Display';font-style:italic;font-weight:500 600;font-display:swap;src:url(../fonts/app/playfair-italic-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Playfair Display';font-style:normal;font-weight:500 700;font-display:swap;src:url(../fonts/app/playfair-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Playfair Display';font-style:normal;font-weight:500 700;font-display:swap;src:url(../fonts/app/playfair-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

/* ==========================================================================
   Akademija Arapski Li · platforma za polaznice · direction "warm"
   The warmth of arapskili.com, lightened for study: paper-white surfaces,
   cream only as a faint tint, hairlines instead of shadows. Teal is the quiet
   working accent; crimson is kept for the logo and the ONE main action.

   Naming: .block, .block__element, .block--modifier, states as .is-*
   Mobile first. Breakpoints: 40em (640px), 48em (768px), 64em (1024px).

   1 Tokens · 2 Base · 3 Shell · 4 Page furniture · 5 Buttons · 6 Badges
   7 Alerts · 8 Forms · 9 Cards · 10 Progress · 11 Levels and lessons
   12 Lesson page · 13 Payment · 14 Product page · 15 Sign-in · 16 Styleguide
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: only light;

  --color-page: #FFFDF9;  /* brand "paper" */
  --color-surface: #FFFFFF;
  --color-tint: #FAF6EE;  /* brand cream, thinned out */
  --color-line: #ECE6DB;  /* hairlines, card borders */
  --color-control: #87939A;  /* input borders, 3.1:1 on white */

  --color-ink: #26343C;  /* headings */
  --color-text: #43515A;  /* body */
  --color-muted: #5F6B73;  /* secondary text, 5.4:1 on white */

  --color-teal: #3F7C89;  /* progress, done marks, focus ring, the cover */
  --color-teal-ink: #2F6672;  /* links and teal text */
  --color-teal-tint: #EAF2F3;
  --color-teal-line: #D5E5E7;

  --color-crimson: #CF104E;  /* logo, main action */
  --color-crimson-dark: #AE0C41;  /* hover, errors */
  --color-rose: #B03858;  /* eyebrows */
  --color-blush: #F4E2E4;

  --color-gold: #CDB583;  /* hairline frames */
  --color-gold-ink: #735A22;
  --color-gold-tint: #F5EDDA;

  --color-telegram: #2AABEE;  /* brand blue, behind the plane */
  --color-telegram-strong: #117BB0;  /* under white text, 4.7:1 */

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Geeza Pro", serif;

  --font-size-2xs: .6875rem;  /* 11 eyebrows, tab labels */
  --font-size-xs: .75rem;  /* 12 badges */
  --font-size-sm: .8125rem;  /* 13 small print */
  --font-size-base: .9375rem;  /* 15 body */
  --font-size-md: 1rem;  /* 16 form inputs (no iOS zoom) */
  --font-size-lg: 1.125rem;  /* 18 card titles */
  --font-size-xl: 1.25rem;  /* 20 section titles */
  --font-size-2xl: 1.375rem;  /* 22 page titles on phones */
  --font-size-3xl: 1.625rem;  /* 26 page titles from 48em, Arabic */

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --size-control: 2.75rem;  /* 44px on phones, 40px from 48em */
  --size-topbar: 3.25rem;
  --size-tabbar: 3.5rem;
  --container: 75rem;
  --gutter: var(--space-5);

  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.6 10 17l8.5-9.4'/%3E%3C/svg%3E");
  --icon-play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.5 5.5v13L19 12z' fill='%23fff'/%3E%3C/svg%3E");
}
@media (min-width: 48em) {
  :root { --size-control: 2.5rem; --size-topbar: 3.75rem; --gutter: var(--space-8); }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  display: flex; flex-direction: column; min-height: 100dvh; margin: 0;
  background: var(--color-page); color: var(--color-text);
  font: 400 var(--font-size-base)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, .h1 {
  margin: 0; color: var(--color-ink);
  font: 600 var(--font-size-xl)/1.22 var(--font-display);
  font-variant-numeric: lining-nums; text-wrap: balance;
}
h1, .h1 { font-size: var(--font-size-2xl); }
/* small titles inside components use the UI face */
.overview__title, .level__title, .alert__title, .auth__first h2 { font: 800 var(--font-size-base)/1.35 var(--font-body); }
p, ul, ol, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { min-width: 0; border: 0; }
a { color: var(--color-teal-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--color-ink); }
strong { color: var(--color-ink); font-weight: 800; }
button, input { color: inherit; font: inherit; }
[lang="ar"] { font-family: var(--font-arabic); letter-spacing: 0; }
:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 2px; border-radius: var(--radius-sm); }

.visually-hidden, .sprite {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -5rem; z-index: 50;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--color-ink); color: #fff; font-weight: 800;
}
.skip-link:focus { top: var(--space-4); color: #fff; }
.icon {
  flex: none; width: 1.25em; height: 1.25em;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container--sm { --container: 36rem; }  /* forms */
.container--md { --container: 42.5rem; }  /* payment */
.container--lg { --container: 56rem; }  /* product page */

@media (min-width: 48em) { h1, .h1 { font-size: var(--font-size-3xl); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- 3. Shell: top bar, navigation, footer, admin strip ---------- */
/* Phones: the four sections are a tab bar pinned to the bottom. .app keeps that
   much room free at the end of the page, so the bar never hides content. */
.app { padding-bottom: calc(var(--size-tabbar) + env(safe-area-inset-bottom, 0px)); }

.topbar { border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.topbar__in { display: flex; align-items: center; gap: var(--space-2); min-height: var(--size-topbar); }
.topbar__logo { display: flex; align-items: center; flex: none; min-height: 2.75rem; margin-right: auto; }
.topbar__logo img { width: auto; height: 1.625rem; }
.topbar__logout .btn { margin-right: calc(var(--space-3) * -1); color: var(--color-muted); font-weight: 700; }

.nav {
  position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--color-line); background: var(--color-surface);
}
.nav__link {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: var(--size-tabbar); color: var(--color-muted);
  font-size: var(--font-size-2xs); font-weight: 700; line-height: 1.3; text-decoration: none;
}
.nav__link .icon { width: 1.5rem; height: 1.5rem; }
.nav__link.is-active { color: var(--color-ink); font-weight: 800; }
.nav__link.is-active::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: 2.25rem; height: 2px;
  margin-left: -1.125rem; background: var(--color-crimson);
}

.footer { padding-block: var(--space-3); border-top: 1px solid var(--color-line); color: var(--color-muted); font-size: var(--font-size-sm); text-align: center; }
.footer a { display: inline-block; padding-block: var(--space-3); color: inherit; }  /* 44px touch target */
.footer__copy { display: block; padding-top: var(--space-2); }
.footer__dot { display: none; }

.adminbar { background: var(--color-ink); color: #fff; font-size: var(--font-size-sm); line-height: 1.4; }
.adminbar__in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-2); }
.adminbar__btn {
  position: relative; flex: none; padding: .2rem .7rem; border: 1px solid rgba(255, 255, 255, .7); border-radius: var(--radius-pill);
  background: none; color: #fff; font-size: var(--font-size-xs); font-weight: 800; cursor: pointer;
}
.adminbar__btn::after { content: ""; position: absolute; inset: -.6rem -.25rem; }  /* 44px touch target */
.adminbar :focus-visible { outline-color: #fff; }

@media (min-width: 48em) {
  .app { padding-bottom: 0; }
  .topbar__in { gap: var(--space-4); }
  .topbar__logo img { height: 1.875rem; }
  .topbar__logout { padding-left: var(--space-2); background: linear-gradient(var(--color-line), var(--color-line)) 0 50% / 1px 1.25rem no-repeat; }
  .nav { position: static; display: flex; align-self: stretch; gap: var(--space-1); padding: 0; border: 0; background: none; }
  .nav__link { flex-direction: row; min-height: 0; padding-inline: var(--space-3); color: var(--color-text); font-size: var(--font-size-base); }
  .nav__link:hover { color: var(--color-ink); }
  .nav__link .icon { display: none; }
  .nav__link.is-active::before { top: auto; bottom: -1px; left: var(--space-3); right: var(--space-3); width: auto; margin: 0; }
  .footer { padding-block: var(--space-2); }
  .footer__copy, .footer__dot { display: inline; padding: 0; }
}

/* ---------- 4. Page furniture ---------- */
.page { padding-block: var(--space-5) var(--space-10); }
.page-head { margin-bottom: var(--space-5); }
.page-head__sub { margin-top: var(--space-1); color: var(--color-muted); }
.page-head--cover { display: flex; align-items: center; gap: var(--space-4); }
.page-head--cover .cover { width: 3rem; }

.section { margin-top: var(--space-8); }
.section__title { margin-bottom: var(--space-3); }
.section__lead { max-width: 38rem; margin: calc(var(--space-1) * -1) 0 var(--space-4); }

.eyebrow { color: var(--color-rose); font: 800 var(--font-size-2xs)/1.3 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }

/* breadcrumbs: every item is 44px high; the block is pulled up so its text sits on the page padding */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin-top: calc(var(--space-3) * -1); color: var(--color-muted); font-size: var(--font-size-sm); }
.crumbs > * { padding-block: var(--space-3); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--color-ink); text-decoration: underline; }

/* small print; --icon puts a line icon in front of it */
.note { color: var(--color-muted); font-size: var(--font-size-sm); }
.note--icon { display: flex; gap: var(--space-3); }
.note--icon .icon { margin-top: .1rem; color: var(--color-teal); font-size: var(--font-size-base); }

/* "Printed paper": the cream tint with the site's own small pattern, thinned to a whisper.
   Only behind the home greeting and the sign-in cover, never behind study content. */
.paper { background: linear-gradient(rgba(250, 246, 238, .6), rgba(250, 246, 238, .6)), var(--color-tint) url("../img/pattern.svg") 0 0 / 14.5rem; }
/* The painted magnolia: always whole, never cropped, faded, rotated or covered.
   It gets a clear patch of plain paper BEHIND it, so the pattern stays away from it. */
.flower { box-sizing: content-box; flex: none; margin: -1rem; padding: 1rem; background: radial-gradient(closest-side, var(--color-tint) 70%, rgba(250, 246, 238, 0)); }

/* greeting on the home page: the one place inside the app with a flower */
.hello { border-bottom: 1px solid var(--color-line); }
.hello__in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-5); }
.hello__title { font-size: 1.5rem; }
.hello__title em { color: var(--color-teal-ink); font-weight: 500; }
.hello__lead { margin-top: var(--space-1); }
.hello__flower { width: 6.5rem; }

@media (min-width: 48em) {
  .page { padding-block: var(--space-8) var(--space-12); }
  .page-head { margin-bottom: var(--space-6); }
  .page-head--cover .cover { width: 3.5rem; }
  .section { margin-top: var(--space-10); }
  .hello__in { padding-block: var(--space-6); }
  .hello__title { font-size: 1.875rem; }
  .hello__lead { font-size: var(--font-size-md); }
  .hello__flower { width: 9.5rem; }
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--size-control); padding: .3rem 1.15rem;
  border: 1px solid transparent; border-radius: var(--radius-pill); background: none;
  font: 800 var(--font-size-base)/1.2 var(--font-body); text-align: center; text-decoration: none;
  cursor: pointer; transition: background-color .15s; -webkit-tap-highlight-color: transparent;
}
.btn .icon { width: 1.15em; height: 1.15em; stroke-width: 2; }
.btn--primary { background: var(--color-crimson); color: #fff; }
.btn--primary:hover { background: var(--color-crimson-dark); color: #fff; }
.btn--secondary { border-color: var(--color-teal); background: var(--color-surface); color: var(--color-teal-ink); }
.btn--quiet { padding-inline: var(--space-3); color: var(--color-teal-ink); }
.btn--secondary:hover, .btn--quiet:hover { background: var(--color-teal-tint); color: var(--color-teal-ink); }
.btn--telegram { background: var(--color-telegram-strong); color: #fff; }
.btn--telegram:hover { background: #0D6898; color: #fff; }
/* the plane sits on a disc of the real Telegram blue, like the app's own mark */
.btn--telegram .icon { width: 1.6em; height: 1.6em; margin-left: -.45em; border-radius: 50%; background: var(--color-telegram); }
.btn--done { border-color: var(--color-teal-line); background: var(--color-teal-tint); color: var(--color-teal-ink); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { border-color: transparent; background: #EFEBE4; color: #717C82; cursor: not-allowed; pointer-events: none; }

/* ---------- 6. Badges: HOW she has a product. Always an icon and words ---------- */
/* Squared corners on purpose: pills are buttons, tags are information. */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem .15rem .4rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 800 var(--font-size-xs)/1.4 var(--font-body); white-space: nowrap;
}
.badge .icon { width: 1rem; height: 1rem; stroke-width: 2; }
.badge--paid { background: var(--color-teal-tint); color: var(--color-teal-ink); }
.badge--included { border-color: var(--color-teal); background: var(--color-surface); color: var(--color-teal-ink); }
.badge--gift { background: var(--color-blush); color: var(--color-crimson-dark); }
.badge--free { border-color: var(--color-control); background: var(--color-surface); color: var(--color-text); }
.badge--trial { background: var(--color-gold-tint); color: var(--color-gold-ink); }
.badge--pending { border: 1px dashed var(--color-gold-ink); background: var(--color-surface); color: var(--color-gold-ink); }
.badge--suspended { background: var(--color-crimson-dark); color: #fff; }

/* ---------- 7. Alerts ---------- */
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--alert-line); border-left-width: 3px;
  border-radius: var(--radius-md); background: var(--alert-bg); color: var(--color-ink);
}
.alert > .icon { margin-top: .1rem; color: var(--alert-ink); font-size: 1rem; }
.alert__body { display: grid; gap: var(--space-1); }
.alert__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.alert--success { --alert-bg: var(--color-teal-tint); --alert-line: var(--color-teal); --alert-ink: var(--color-teal-ink); }
.alert--info { --alert-bg: var(--color-surface); --alert-line: var(--color-teal); --alert-ink: var(--color-teal-ink); }
.alert--warning { --alert-bg: #FCF7EA; --alert-line: var(--color-gold); --alert-ink: var(--color-gold-ink); }
.alert--error { --alert-bg: #FCF3F4; --alert-line: var(--color-crimson-dark); --alert-ink: var(--color-crimson-dark); }
.alert--suspended { --alert-bg: var(--color-blush); --alert-line: var(--color-crimson-dark); --alert-ink: var(--color-crimson-dark); }

/* ---------- 8. Forms ---------- */
.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: var(--space-1); }
.field__label { color: var(--color-ink); font-weight: 800; }
.field__hint { color: var(--color-muted); font-size: var(--font-size-sm); font-weight: 400; }
.field__input {
  width: 100%; min-height: var(--size-control); padding: .45rem .8rem;
  border: 1px solid var(--color-control); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-ink); font-size: var(--font-size-md);
}
.field__input:focus-visible, .field__input.is-focus { outline: 3px solid var(--color-teal); outline-offset: 1px; border-color: var(--color-teal-ink); }
.field.is-invalid .field__input { border-color: var(--color-crimson-dark); box-shadow: inset 0 0 0 1px var(--color-crimson-dark); }
.field__error { display: flex; align-items: center; gap: var(--space-1); color: var(--color-crimson-dark); font-size: var(--font-size-sm); font-weight: 700; }

.checks { display: grid; margin-top: var(--space-1); }
.check { display: flex; align-items: center; gap: var(--space-3); min-height: var(--size-control); cursor: pointer; }
.check__input {
  -webkit-appearance: none; appearance: none; flex: none; width: 1.375rem; height: 1.375rem; margin: 0;
  border: 1.5px solid var(--color-control); border-radius: var(--radius-sm);
  background: var(--color-surface) center / .9rem no-repeat; cursor: pointer;
}
.check__input:checked { border-color: var(--color-teal-ink); background-color: var(--color-teal-ink); background-image: var(--icon-check); }

/* ---------- 9. Cards ---------- */
.card { padding: var(--space-5); border: 1px solid var(--color-line); border-radius: var(--radius-lg); background: var(--color-surface); }
/* the home grid: 1, 2 or 3 columns; the featured card takes a whole row */
.cards { display: grid; gap: var(--space-3); }
.cards > .feature, .cards__note { grid-column: 1 / -1; }
.cards__note { align-self: center; padding: var(--space-2) var(--space-1); }

/* the Academy as a small teal notebook: the cover from arapskili.com in miniature */
.cover {
  position: relative; display: grid; place-items: center; flex: none; width: 3.5rem; aspect-ratio: 3 / 4;
  border-radius: 2px 6px 6px 2px; background: var(--color-teal);
  box-shadow: inset 3px 0 0 rgba(0, 0, 0, .14), 0 4px 8px -4px rgba(47, 102, 114, .6);
}
.cover::after { content: ""; position: absolute; inset: 4px 4px 4px 7px; border: 1px solid var(--color-gold); border-radius: 2px; }
.cover img { width: 50%; margin-left: 3px; }
/* a real book cover: the only other place with a (small) shadow */
.product__cover, .book__cover { border-radius: 2px; box-shadow: 0 0 0 1px rgba(38, 52, 60, .08), 0 8px 12px -8px rgba(38, 52, 60, .5); }

/* product card: type, title, one line; badge and actions are pinned to the bottom */
.product { display: flex; flex-direction: column; gap: var(--space-3); }
.product__head { display: flex; flex: 1 0 auto; align-items: flex-start; gap: var(--space-4); }
.product__text { flex: 1; display: grid; gap: var(--space-1); }
.product__title { font-size: var(--font-size-lg); }
.product__desc { margin-top: var(--space-1); }
.product__cover { flex: none; width: 4rem; }
.product__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* featured card: the Academy she is enrolled in or, on cream (--offer), the enrolment offer */
.feature { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-4); }
.feature__text { display: grid; gap: var(--space-1); }
.feature__title { font-size: var(--font-size-xl); }
.feature__body { grid-column: 1 / -1; display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.feature__row, .overview__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.feature__row { color: var(--color-ink); }
.feature__action { grid-column: 1 / -1; }
.feature--offer { background: var(--color-tint); }

@media (min-width: 40em) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
  .feature__action { justify-self: start; }
}
@media (min-width: 48em) {
  .card { padding: var(--space-6); }
  .cover { width: 4.75rem; }
  .feature__title { font-size: var(--font-size-2xl); }
}
@media (min-width: 64em) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
  .cards__note { grid-column: span 2; padding-inline: var(--space-4); }
  .feature { grid-template-columns: auto minmax(0, 1fr) minmax(0, 21rem) auto; gap: var(--space-8); }
  .feature__body { grid-column: auto; padding: 0 0 0 var(--space-8); border-top: 0; border-left: 1px solid var(--color-line); }
  .feature__action { grid-column: auto; }
}

/* ---------- 10. Progress ---------- */
.progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: .375rem;
  border: 0; border-radius: var(--radius-pill); overflow: hidden;
  background: var(--color-teal-line); color: var(--color-teal);
}
.progress::-webkit-progress-bar { background: var(--color-teal-line); }
.progress::-webkit-progress-value { border-radius: var(--radius-pill); background: var(--color-teal); }
.progress::-moz-progress-bar { border-radius: var(--radius-pill); background: var(--color-teal); }
.progress--mini { width: 3rem; height: .25rem; }

/* ---------- 11. Levels (native <details>) and the lesson list ---------- */
.levels { padding: 0; overflow: hidden; }
.level { scroll-margin-top: var(--space-4); }
.level + .level { border-top: 1px solid var(--color-line); }
.level__summary { display: flex; align-items: center; gap: var(--space-3); min-height: 3.25rem; padding: var(--space-2) var(--space-4); cursor: pointer; list-style: none; }
.level__summary::-webkit-details-marker { display: none; }
.level__summary:hover { background: var(--color-tint); }
.level__summary:focus-visible { outline-offset: -3px; border-radius: var(--radius-lg); }
.level__title { flex: 1; }
.level__count { color: var(--color-muted); font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.level__summary .progress { display: none; }
.level__chevron { color: var(--color-muted); font-size: 1rem; transition: transform .2s; }
.level[open] > .level__summary .level__chevron { transform: rotate(180deg); }

/* one lesson = one link; its state is a class AND a different glyph (ring, check, play) */
.lessons { padding: 0 var(--space-2) var(--space-3); }
.lesson {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--size-control);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
  color: var(--color-text); line-height: 1.35; text-decoration: none;
}
.lesson::before {
  content: ""; flex: none; width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--color-control); border-radius: 50%;
  background: center / .75rem no-repeat;
}
.lesson:hover { background: var(--color-tint); color: var(--color-ink); }
.lesson.is-done { color: var(--color-muted); }
.lesson.is-done::before { border-color: var(--color-teal); background-color: var(--color-teal); background-image: var(--icon-check); }
.lesson.is-current { background: var(--color-teal-tint); color: var(--color-ink); font-weight: 800; }
.lesson.is-current::before { border-color: var(--color-teal-ink); background-color: var(--color-teal-ink); background-image: var(--icon-play); }
.lesson__tag {
  padding: .1rem .45rem; border: 1px solid var(--color-teal); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-teal-ink); font-size: var(--font-size-xs); white-space: nowrap;
}

@media (min-width: 48em) {
  .level__summary { padding-inline: var(--space-5); }
  .lessons { padding: 0 var(--space-3) var(--space-4); }
  /* .levels--wide: the full-width list on the Academy page, lessons in two columns */
  .levels--wide .level__summary .progress { display: block; }
  .levels--wide .lessons { columns: 2; column-gap: var(--space-5); }
  .levels--wide .lessons > li { break-inside: avoid; }
}

/* Academy page: three cards (progress, fee, Telegram group) above the list */
.overview { display: grid; gap: var(--space-3); }
.overview .card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.overview__head { width: 100%; }
.overview .progress { margin-bottom: var(--space-1); }
.overview .card > .btn { margin-top: var(--space-2); }
/* "continue learning": the main action of the page, on a cream inset */
.resume { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-tint); }
.resume__lesson { color: var(--color-ink); font-weight: 800; }

@media (min-width: 64em) {
  .overview { grid-template-columns: 1.1fr 1.1fr .9fr; gap: var(--space-5); }
  .overview .card > .btn, .resume { margin-top: auto; }
}

/* ---------- 12. Lesson page ---------- */
/* Source order: lesson first, list second. Phones show the video first, edge to edge
   (no top padding there); from 64em the list sits to the left of the video. */
.page--lesson { padding-top: 0; }
.lesson-layout { display: grid; gap: var(--space-8); }
.lesson-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.lesson-main .page-head { margin: 0; }
.player {
  order: -1; display: grid; place-items: center; aspect-ratio: 16 / 9; margin-inline: calc(var(--gutter) * -1);
  background: radial-gradient(closest-side, #35464F, var(--color-ink)); color: #fff;
}
.player__play { display: grid; place-items: center; width: 3.75rem; height: 3.75rem; border: 1.5px solid rgba(255, 255, 255, .8); border-radius: 50%; background: rgba(255, 255, 255, .12); }
.player__play .icon { width: 1.75rem; height: 1.75rem; margin-left: .15rem; }
.lesson-actions { display: grid; gap: var(--space-2); }
.lesson-actions__nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.notes { display: grid; gap: var(--space-3); margin-top: var(--space-2); }
.prose { display: grid; gap: var(--space-3); }
.prose > p { max-width: 42rem; }
/* Arabic: right-to-left, Noto Naskh, comfortably larger than the Latin text around it */
.prose > [lang="ar"] { max-width: none; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--color-tint); color: var(--color-ink); font-size: var(--font-size-3xl); line-height: 1.9; }
.lesson-nav__head { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }

@media (min-width: 48em) {
  .page--lesson { padding-top: var(--space-8); }
  .player { order: 0; margin-inline: 0; border-radius: var(--radius-lg); }
  .lesson-actions { grid-template-columns: auto auto; justify-content: space-between; }
}
@media (min-width: 64em) {
  .lesson-layout { grid-template-columns: 19rem minmax(0, 1fr); gap: var(--space-10); align-items: start; }
  .lesson-main { grid-column: 2; grid-row: 1; }
  .lesson-nav { grid-column: 1; grid-row: 1; position: sticky; top: var(--space-5); max-height: calc(100dvh - 2.5rem); overflow-y: auto; }
}

/* ---------- 13. Payment ---------- */
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); }
.plan__price { color: var(--color-ink); font: 600 1.5rem/1.15 var(--font-display); font-variant-numeric: lining-nums; white-space: nowrap; }
.plan__name { color: var(--color-ink); font-weight: 700; }
.plan .note { margin-top: var(--space-1); }
.plan .btn { min-width: 6.5rem; }
/* her own package: framed in teal, the button under the text on phones */
.plan--current { grid-template-columns: minmax(0, 1fr); border-color: var(--color-teal); box-shadow: inset 0 0 0 1px var(--color-teal); }
.plan--current .plan__price { margin-bottom: var(--space-1); font-size: 2.125rem; }
.plan--current .btn { width: 100%; }
.plans { padding-block: 0; }
.plans .plan { padding-block: var(--space-4); }
.plans .plan + .plan { border-top: 1px solid var(--color-line); }
.page > .note { margin-top: var(--space-6); }

@media (min-width: 40em) {
  .plan--current { grid-template-columns: minmax(0, 1fr) auto; }
  .plan--current .btn { width: auto; }
  .plans .plan__info { display: flex; align-items: baseline; gap: var(--space-5); }
  .plans .plan__price { min-width: 4.25rem; }
}

/* ---------- 14. Product page (a book) ---------- */
/* one card: a cream "shelf" with the cover, above the text on phones, beside it from 40em */
.book { display: grid; padding: 0; overflow: hidden; }
.book__media { display: grid; place-items: center; padding: var(--space-6); background: var(--color-tint); }
.book__cover { width: 9.5rem; }
.book__body { display: grid; align-content: center; justify-items: start; gap: var(--space-3); padding: var(--space-5); }
.book__desc { max-width: 34rem; }
.book__actions { display: grid; gap: var(--space-2); width: 100%; margin-top: var(--space-2); }

@media (min-width: 40em) {
  .book { grid-template-columns: 17rem minmax(0, 1fr); }
  .book__media { padding: var(--space-10) var(--space-6); }
  .book__cover { width: 11rem; }
  .book__body { padding: var(--space-8); }
  .book__actions { display: flex; }
}

/* ---------- 15. Sign-in ---------- */
.auth { display: grid; gap: var(--space-5); width: min(100% - 2 * var(--gutter), 25rem); margin-inline: auto; padding-block: var(--space-6) var(--space-8); text-align: center; }
.auth__brand { display: grid; justify-items: center; gap: var(--space-2); }
.auth__brand img { width: auto; height: 2.125rem; }
/* the brand moment: a paper "cover" with one magnolia and the school's motto */
.auth__art { position: relative; display: grid; justify-items: center; align-content: center; padding: var(--space-6) var(--space-4); }
/* a thin gold frame inside its edge, as on the notebook cover (it never touches the flower) */
.auth__art::after { content: ""; position: absolute; inset: .375rem; border: 1px solid var(--color-gold); border-radius: var(--radius-md); opacity: .7; pointer-events: none; }
.auth__flower { width: 9.5rem; }
.auth__motto { margin-top: var(--space-2); color: var(--color-teal-ink); font-size: 1.5rem; font-weight: 600; line-height: 1.7; }
.auth__motto-tr { color: var(--color-muted); font: italic 500 var(--font-size-base)/1.4 var(--font-display); }
.auth__main { display: grid; gap: var(--space-3); }
.auth__main h1 { font-size: var(--font-size-3xl); }
.auth__form { display: grid; justify-items: center; gap: var(--space-1); margin-top: var(--space-2); }
.auth__first { display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-5); background: var(--color-tint); text-align: left; }

@media (min-width: 64em) {
  /* form on the left, the cover on the right; the empty 1fr rows keep the left column together */
  .auth {
    grid-template: ". art" 1fr "brand art" auto "main art" auto "first art" auto ". art" 1fr / 24rem minmax(0, 1fr);
    gap: var(--space-6) 5rem; width: min(100% - 2 * var(--gutter), 62rem); padding-block: var(--space-8); text-align: left;
  }
  .auth__brand { grid-area: brand; justify-items: start; margin-bottom: var(--space-4); }
  .auth__brand img { height: 2.5rem; }
  .auth__main { grid-area: main; }
  .auth__main h1 { font-size: 2rem; }
  .auth__form { justify-items: start; }
  .auth__first { grid-area: first; }
  .auth__art { grid-area: art; align-self: center; min-height: 36rem; padding: var(--space-10); border-radius: 1.5rem; }
  .auth__art::after { inset: .625rem; border-radius: 1rem; }
  .auth__flower { width: 19rem; }
  .auth__motto { margin-top: var(--space-6); font-size: 2.125rem; }
  .auth__motto-tr { font-size: var(--font-size-lg); }
}

/* ---------- 16. Styleguide page only (leave out of production) ---------- */
.sg-section { margin-top: var(--space-10); padding-top: var(--space-6); border-top: 1px solid var(--color-line); }
.sg-lead { max-width: 44rem; margin: var(--space-1) 0 var(--space-5); color: var(--color-muted); }
.sg-label { margin: var(--space-5) 0 var(--space-2); color: var(--color-muted); font: 700 var(--font-size-xs)/1.4 ui-monospace, Menlo, monospace; }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.sg-stack { display: grid; gap: var(--space-3); max-width: 44rem; }
.sg-box { height: 1.5rem; background: var(--color-teal); }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--space-3); }
/* colour chip (--c) on top, name and token under it */
.sg-swatch { padding: 3.5rem var(--space-3) var(--space-2); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: linear-gradient(var(--c), var(--c)) 0 0 / 100% 3rem no-repeat var(--color-surface); font-size: var(--font-size-xs); line-height: 1.4; }

/* ==========================================================================
   12 Additions for the live platform
   ========================================================================== */
/* A real video player inside .player */
.player { position: relative; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player--empty { color: rgba(255, 255, 255, .85); font-size: var(--font-size-sm); text-align: center; padding: var(--space-4); }
/* Rich text written by the school in the admin area */
.prose ul, .prose ol { margin: 0; padding-left: 1.4em; }
.prose h2, .prose h3 { margin: 0; font-size: var(--font-size-lg); }
.prose [dir="rtl"] { text-align: right; }
.prose a { color: var(--color-teal-ink); }
/* Empty states and simple notices inside a card */
.empty { color: var(--color-muted); }
.stack { display: grid; gap: var(--space-4); }
.inline-form { display: inline; }
