/* =========================================================================
   Concours Maroc — design system for the whole site (and the Android app)
   Identity: night blue and Majorelle blue, saffron for highlights, and the
   eight-point zellij star as the signature motif. Green and red are kept
   for right and wrong answers only.
   Fonts: Plus Jakarta Sans (Latin) and Readex Pro (Arabic), self-hosted
   under the SIL Open Font License (assets/fonts/). One stylesheet, no
   framework.
   ========================================================================= */

@font-face {
  font-family: "CM Sans";
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  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: "CM Sans";
  src: url("../fonts/readex-pro-arabic-wght-normal.woff2") format("woff2");
  font-weight: 160 700; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-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;
}

:root {
  --navy-950: #0b1229;
  --navy-900: #101a3d;
  --navy-800: #172456;
  --navy-700: #1e2f6e;
  --majorelle: #3a49d6;
  --majorelle-600: #2a37b0;
  --majorelle-300: #8d9bff;
  --saffron: #f5a524;
  --saffron-300: #ffc266;
  --red: #d93b3b;

  /* one hue per family of concours (cards, icons) */
  --h-sante: #e0457b;
  --h-ingenierie: #2f6bff;
  --h-commerce: #e8912d;
  --h-arts: #d2553c;
  --h-enseignement: #8b5cf6;
  --h-militaire: #a16b2b;
  --h-securite: #0e7490;
  --h-formation: #52627a;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --surface-3: #e2e7f2;
  --ink: #0e1630;
  --ink-2: #33405f;
  --muted: #5d6884;
  --line: #dfe4ef;
  --line-2: #cbd3e4;
  --accent: var(--majorelle);
  --accent-2: var(--majorelle-600);
  --accent-ink: #ffffff;
  --accent-soft: #ebeeff;
  --hl: var(--saffron);
  --gold: #a15c00;
  --gold-soft: #fff3dc;
  --sky-bg: #e7f5fb;
  --sky-ink: #0b5d78;
  --ok-bg: #e4f6ec;
  --ok-line: #20a066;
  --ok-ink: #0c5b39;
  --bad-bg: #fde9e8;
  --bad-line: #d93b3b;
  --bad-ink: #8e1c1c;
  --warn-bg: #fff5e0;
  --warn-line: #eaa23a;
  --warn-ink: #744a00;
  --info-bg: #ebeeff;
  --info-line: #5865e6;
  --info-ink: #26309a;
  --band-bg: #eaeefc;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%233A49D6' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpath d='M22 22h28v28H22z'/%3E%3Cpath d='M36 16.2 55.8 36 36 55.8 16.2 36z'/%3E%3Cpath d='M36 16.2V0M55.8 36H72M36 55.8V72M16.2 36H0M22 22 0 0M50 22 72 0M50 50l22 22M22 50 0 72'/%3E%3C/g%3E%3C/svg%3E");
  --pattern-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M22 22h28v28H22z'/%3E%3Cpath d='M36 16.2 55.8 36 36 55.8 16.2 36z'/%3E%3Cpath d='M36 16.2V0M55.8 36H72M36 55.8V72M16.2 36H0M22 22 0 0M50 22 72 0M50 50l22 22M22 50 0 72'/%3E%3C/g%3E%3C/svg%3E");
  --shadow-sm: 0 1px 2px rgba(14, 22, 48, .06);
  --shadow: 0 1px 2px rgba(14, 22, 48, .05), 0 8px 24px rgba(14, 22, 48, .06);
  --shadow-lift: 0 2px 6px rgba(14, 22, 48, .07), 0 18px 40px rgba(14, 22, 48, .12);

  --font-ui: "CM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-ar: "CM Sans", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", "Droid Arabic Naskh", sans-serif;
  --fs-xs: .78rem;
  --fs-sm: .9rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  --tap: 46px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --gap: 16px;
  --pad: 20px;
  --maxw: 1180px;
  --readw: 760px;
  --header-h: 64px;
  --star: polygon(50% 0%, 61.7% 21.7%, 85.4% 14.6%, 78.3% 38.3%, 100% 50%, 78.3% 61.7%, 85.4% 85.4%, 61.7% 78.3%,
                  50% 100%, 38.3% 78.3%, 14.6% 85.4%, 21.7% 61.7%, 0% 50%, 21.7% 38.3%, 14.6% 14.6%, 38.3% 21.7%);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #090f22;
  --surface: #101833;
  --surface-2: #16203f;
  --surface-3: #1e2a50;
  --ink: #e8ecf8;
  --ink-2: #c2cae0;
  --muted: #95a1bf;
  --line: #233052;
  --line-2: #2e3c63;
  --accent: var(--majorelle-300);
  --accent-2: #a9b4ff;
  --accent-ink: #0a1024;
  --accent-soft: #1b2557;
  --hl: var(--saffron-300);
  --gold: var(--saffron-300);
  --gold-soft: #3a2a0e;
  --sky-bg: #0f2e3a;
  --sky-ink: #9fdcf2;
  --ok-bg: #0e3324;
  --ok-line: #34c17f;
  --ok-ink: #a8ebc9;
  --bad-bg: #3b1418;
  --bad-line: #f06a6a;
  --bad-ink: #ffc9c9;
  --warn-bg: #3a2a0e;
  --warn-line: #f2b24c;
  --warn-ink: #fce0a6;
  --info-bg: #1b2557;
  --info-line: #8d9bff;
  --info-ink: #d3d9ff;
  --band-bg: #111a38;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%238D9BFF' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpath d='M22 22h28v28H22z'/%3E%3Cpath d='M36 16.2 55.8 36 36 55.8 16.2 36z'/%3E%3Cpath d='M36 16.2V0M55.8 36H72M36 55.8V72M16.2 36H0M22 22 0 0M50 22 72 0M50 50l22 22M22 50 0 72'/%3E%3C/g%3E%3C/svg%3E");
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ========================================================== base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { overflow-x: clip; }
html[dir="rtl"] body { font-family: var(--font-ar); line-height: 1.85; }
[lang="ar"] { font-family: var(--font-ar); }
[lang="fr"], [lang="en"] { font-family: var(--font-ui); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 750; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); font-weight: 800; letter-spacing: -.022em; word-spacing: .04em; }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.8rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; margin-top: 1.3em; letter-spacing: -.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 { letter-spacing: 0; line-height: 1.45; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-2); text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
h1 > svg, h2 > svg, h3 > svg { width: 1.05em; height: 1.05em; vertical-align: -.15em; fill: currentColor; }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
li { margin: .25em 0; }
small { font-size: var(--fs-xs); }
strong, b { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
  background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hero :focus-visible, .site-footer :focus-visible, .cta-box :focus-visible { outline-color: var(--saffron); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--r-sm); }
.skip-link:focus { top: 10px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.narrow { max-width: var(--readw); }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* signature: eight-point zellij star as eyebrow mark */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-xs); font-weight: 750; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.eyebrow::before { content: ""; flex: 0 0 11px; width: 11px; height: 11px; background: var(--hl); clip-path: var(--star); }
html[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: var(--fs-sm); }

/* hues: one per family of concours, plus a small palette for other tiles */
[data-group="sante"] { --hue: var(--h-sante); }
[data-group="ingenierie"] { --hue: var(--h-ingenierie); }
[data-group="commerce"] { --hue: var(--h-commerce); }
[data-group="architecture-arts"] { --hue: var(--h-arts); }
[data-group="enseignement"] { --hue: var(--h-enseignement); }
[data-group="militaire"] { --hue: var(--h-militaire); }
[data-group="securite"] { --hue: var(--h-securite); }
[data-group="formation"] { --hue: var(--h-formation); }
.hue-blue { --hue: #2f6bff; }
.hue-indigo { --hue: var(--majorelle); }
.hue-violet { --hue: #8b5cf6; }
.hue-rose { --hue: #e0457b; }
.hue-terra { --hue: #d2553c; }
.hue-amber { --hue: #e08a1e; }
.hue-cyan { --hue: #0e7490; }
.hue-slate { --hue: #52627a; }
:root[data-theme="dark"] .hue-indigo { --hue: var(--majorelle-300); }

/* ========================================================== header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 10px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.brand svg { width: 36px; height: 36px; flex: 0 0 36px; }
.brand span b { color: var(--accent); }
.brand:hover { color: var(--ink); }
html[dir="rtl"] .brand { letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm);
  padding: 8px 13px; border-radius: 999px; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a.lang-switch { border: 1px solid var(--line-2); margin-inline-start: 6px; }
.hdr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--ink); cursor: pointer; flex: 0 0 auto; transition: background .15s ease;
}
.hdr-btn:hover { background: var(--surface-2); }
.hdr-btn svg { width: 22px; height: 22px; fill: currentColor; }
.menu-btn { display: none; }
@media (max-width: 920px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lift);
    padding: 10px var(--pad) 16px; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: var(--fs-md); border-radius: 12px; }
  .nav a.lang-switch { margin: 6px 0 0; text-align: center; }
  .site-header .bar { position: relative; }
  .hdr-tools { margin-inline-start: auto; }
}
.hdr-tools { display: flex; align-items: center; gap: 2px; }

/* search */
.search-wrap { position: relative; }
.search-panel {
  display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 10px);
  width: min(92vw, 470px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lift); padding: 12px; z-index: 60;
}
.search-panel.open { display: block; }
/* phones: the panel spans the header bar instead of hanging off the search
   button, which sits away from the edge (theme and menu buttons follow it) */
@media (max-width: 920px) {
  .search-wrap { position: static; }
  .search-panel { inset-inline: 8px; width: auto; top: calc(100% + 6px); }
}
.search-panel input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.search-panel input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.search-results li { margin: 0; }
.search-results a { display: block; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.search-results small { display: block; color: var(--muted); font-weight: 400; }
.big-search { position: relative; max-width: 640px; }
.big-search input {
  width: 100%; min-height: 56px; padding: 12px 16px; padding-inline-start: 50px; font: inherit; font-size: 1.05rem;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.big-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); }
.big-search svg { position: absolute; inset-inline-start: 17px; top: 17px; width: 22px; height: 22px; fill: var(--muted); }
.big-search .search-results { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lift); padding: 6px; }
.big-search .search-results:empty { display: none; }

/* ========================================================== hero (home) */
.hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  padding: 60px 0 68px;
  background:
    radial-gradient(640px 420px at 88% 0%, rgba(58, 73, 214, .55), transparent 70%),
    radial-gradient(520px 380px at 0% 100%, rgba(245, 165, 36, .16), transparent 70%),
    var(--pattern-dark),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-800) 100%);
}
.hero::before {
  content: ""; position: absolute; z-index: -1; width: 560px; height: 560px;
  inset-inline-end: -170px; top: -190px; clip-path: var(--star);
  background: linear-gradient(200deg, rgba(245, 165, 36, .22), rgba(58, 73, 214, 0) 70%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; width: 220px; height: 220px;
  inset-inline-start: -80px; bottom: -90px; clip-path: var(--star);
  border: 0; background: linear-gradient(20deg, rgba(141, 155, 255, .18), rgba(141, 155, 255, 0));
}
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; max-width: 17ch; margin-bottom: .45em; letter-spacing: -.02em; word-spacing: .06em; }
html[dir="rtl"] .hero h1 { max-width: 20ch; line-height: 1.35; }
.hero .hl { color: var(--saffron); }
.hero .eyebrow { color: var(--saffron-300); }
.hero .lead { font-size: clamp(1.02rem, 2.1vw, 1.18rem); color: #c9d2ea; max-width: 60ch; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } .hero { padding: 40px 0 44px; } }
.hero .big-search { margin: 24px 0 16px; }
.hero .big-search input { border-color: transparent; box-shadow: 0 14px 40px rgba(3, 7, 25, .35); }
:root[data-theme="dark"] .hero .big-search input { background: var(--surface-2); border-color: var(--line-2); }
.hero .btn { background: var(--saffron); color: var(--navy-950); box-shadow: 0 8px 22px rgba(245, 165, 36, .28); }
.hero .btn:hover { background: #ffb84d; color: var(--navy-950); }
.hero .btn.ghost { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .28); box-shadow: none; }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.hero-art {
  background: var(--surface); color: var(--ink); border-radius: var(--r-xl); padding: 22px;
  box-shadow: 0 24px 60px rgba(3, 7, 25, .45); border: 1px solid rgba(255, 255, 255, .08);
}
.hero-art h2 { color: var(--ink); display: flex; align-items: center; gap: 8px; }
.hero-art h2 svg { color: var(--accent); }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.stat-row li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: var(--fs-sm); margin: 0; }
.stat-row b { color: var(--accent); font-size: 1.05rem; }
.hero .stat-row { gap: 12px 34px; margin-top: 30px; }
.hero .stat-row li { background: none; border: 0; padding: 0; color: #aeb9d9; display: flex; flex-direction: column; line-height: 1.3; }
.hero .stat-row b { color: #fff; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.hero .stat-row li:nth-child(odd) b { color: #fff; }
.hero .stat-row li:last-child b { color: var(--saffron); }

/* ========================================================== buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(14, 22, 48, .08);
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--accent-2); color: var(--accent-ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn.quiet { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn.quiet:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.btn.accent, .btn.gold { background: var(--saffron); color: var(--navy-950); }
.btn.accent:hover, .btn.gold:hover { background: #ffb84d; color: var(--navy-950); box-shadow: 0 8px 20px rgba(245, 165, 36, .3); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #b92f2f; color: #fff; }
.btn.sm { min-height: 38px; padding: 7px 14px; font-size: var(--fs-sm); border-radius: 10px; }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.more-link svg { width: 18px; height: 18px; fill: currentColor; transition: transform .15s ease; }
.more-link:hover { text-decoration: none; }
.more-link:hover svg { transform: translateX(3px); }
html[dir="rtl"] .more-link svg { transform: scaleX(-1); }
html[dir="rtl"] .more-link:hover svg { transform: scaleX(-1) translateX(3px); }

/* ========================================================== sections & cards */
.section { padding: 44px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section.tight { padding: 28px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: 6px; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.section-head > a:not(.btn) { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.section-head > a:not(.btn):hover { text-decoration: underline; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--hue, var(--accent)) 45%, var(--line)); color: inherit; }
.card .card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card .card-ico {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--hue, var(--accent)) 12%, var(--surface)); color: var(--hue, var(--accent));
}
:root[data-theme="dark"] .card .card-ico { background: color-mix(in srgb, var(--hue, var(--accent)) 24%, var(--surface)); color: color-mix(in srgb, var(--hue, var(--accent)) 55%, #fff); }
.card .card-ico svg { width: 22px; height: 22px; fill: currentColor; }
.card .card-title { font-weight: 750; font-size: 1.06rem; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); }
html[dir="rtl"] .card .card-title { letter-spacing: 0; font-weight: 650; }
.card .card-sub { color: var(--muted); font-size: var(--fs-sm); margin: 0; line-height: 1.55; }
.card .card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* clickable cards: arrow appears on hover; concours cards get a colour bar */
.path-card { position: relative; overflow: hidden; }
.path-card::after {
  content: "→"; position: absolute; inset-inline-end: 18px; top: 18px;
  font-weight: 800; color: var(--hue, var(--accent)); opacity: 0; transform: translateX(-6px);
  transition: opacity .15s ease, transform .15s ease;
}
html[dir="rtl"] .path-card::after { content: "←"; transform: translateX(6px); }
a.path-card:hover::after { opacity: 1; transform: none; }
a.card[data-concours] { padding-top: 22px; }
a.card[data-concours]::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--hue, var(--accent)), color-mix(in srgb, var(--hue, var(--accent)) 35%, transparent));
}
html[dir="rtl"] a.card[data-concours]::before { background: linear-gradient(270deg, var(--hue, var(--accent)), color-mix(in srgb, var(--hue, var(--accent)) 35%, transparent)); }

.badge, .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap; line-height: 1.6;
}
.badge.green, .chip.on { background: var(--accent-soft); color: var(--accent); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.red { background: var(--bad-bg); color: var(--bad-ink); }
.badge.blue { background: var(--sky-bg); color: var(--sky-ink); }
a.chip { text-decoration: none; transition: background .15s ease, color .15s ease; }
.chip { white-space: normal; max-width: 100%; }
a.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ========================================================== page top band */
.breadcrumb { font-size: var(--fs-sm); color: var(--muted); padding: 16px 0 0; }
.breadcrumb.container { padding-inline: var(--pad); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "›"; color: var(--line-2); font-weight: 700; }
html[dir="rtl"] .breadcrumb li + li::before { content: "‹"; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--ink-2); font-weight: 600; }

/* full-width tinted band behind the breadcrumb and the page header */
.breadcrumb, .page-head { position: relative; isolation: isolate; }
.breadcrumb::before, .page-head::before {
  content: ""; position: absolute; z-index: -2; top: 0; bottom: 0; left: 50%; width: 100vw;
  transform: translateX(-50%); background: var(--band-bg); pointer-events: none;
}
.page-head::before { border-bottom: 1px solid var(--line); }
/* zellij lattice on the outer side of the band, fading inwards and upwards */
.page-head::after {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; width: min(46vw, 560px);
  inset-inline-end: calc((100% - 100vw) / 2); background: var(--pattern); pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 25%, transparent), linear-gradient(to bottom, transparent, #000 45%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to left, #000 25%, transparent), linear-gradient(to bottom, transparent, #000 45%);
  mask-composite: intersect;
}
html[dir="rtl"] .page-head::after {
  -webkit-mask-image: linear-gradient(to right, #000 25%, transparent), linear-gradient(to bottom, transparent, #000 45%);
  mask-image: linear-gradient(to right, #000 25%, transparent), linear-gradient(to bottom, transparent, #000 45%);
}

/* ========================================================== article layout */
.page-head { padding: 14px 0 30px; margin-bottom: 4px; }
.page-head h1 { margin-bottom: .35em; max-width: 26ch; }
html[dir="rtl"] .page-head h1 { max-width: 30ch; }
.page-head .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 68ch; }
.updated { font-size: var(--fs-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 0; }
.page-head .updated .btn.quiet { background: var(--surface); border-color: var(--line); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 44px; align-items: start; padding: 26px 0 40px; }
/* the side column spans the whole article, so that .aside-sticky can follow the reading */
.layout > aside { align-self: stretch; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; } .layout aside { order: -1; } }
@media (max-width: 1000px) { .tool-layout aside { order: 0; } }
.prose { max-width: var(--readw); }
.prose h2 { margin-top: 2em; }
.prose h2::before { content: ""; display: block; width: 34px; height: 4px; border-radius: 4px; background: var(--hl); margin-bottom: 14px; }
.prose section:first-of-type h2, .prose h2:first-child { margin-top: .6em; }
.prose table { margin: 1em 0 1.4em; }
.prose img { border-radius: var(--r-md); }
.prose li::marker { color: var(--accent); }
.aside-sticky { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; margin: -2px; }
.aside-sticky > * { flex-shrink: 0; }
@media (max-width: 1000px) { .aside-sticky { position: static; max-height: none; overflow: visible; } }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; font-size: var(--fs-sm); box-shadow: var(--shadow-sm); }
.toc strong { display: inline; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
html[dir="rtl"] .toc strong { letter-spacing: 0; font-size: var(--fs-sm); }
.toc summary { cursor: pointer; margin-bottom: 8px; }
.toc ol { margin: 0; padding-inline-start: 1.2em; }
.toc li { margin: .35em 0; }
.toc li::marker { color: var(--muted); font-weight: 700; font-size: .85em; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 1000px) { .toc details:not([open]) ol { display: none; } }

.cta-box {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--pattern-dark), linear-gradient(140deg, var(--navy-900), var(--majorelle-600));
  color: #fff; border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow);
}
.cta-box::after { content: ""; position: absolute; z-index: -1; width: 140px; height: 140px; inset-inline-end: -40px; bottom: -50px; clip-path: var(--star); background: rgba(245, 165, 36, .22); }
.cta-box h3, .cta-box p { color: #fff; margin-top: 0; }
.cta-box p { color: #d5dcf2; font-size: var(--fs-sm); }
.cta-box .btn { background: var(--saffron); color: var(--navy-950); box-shadow: none; }
.cta-box .btn:hover { background: #ffb84d; color: var(--navy-950); }
.cta-box .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.cta-box .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* key facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); gap: 12px; margin: 24px 0 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.fact .f-lab { font-size: .72rem; color: var(--accent); font-weight: 750; text-transform: uppercase; letter-spacing: .09em; }
html[dir="rtl"] .fact .f-lab { letter-spacing: 0; font-size: var(--fs-xs); }
.fact .f-val { font-weight: 700; margin-top: 4px; line-height: 1.4; color: var(--ink); }
@media (max-width: 560px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fact { padding: 12px; }
  .fact .f-val { font-size: var(--fs-sm); overflow-wrap: anywhere; }
}

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; color: var(--ink); }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
tr:last-child td { border-bottom: 0; }
.table-wrap table { margin: 0; }

/* callouts */
.callout { border-radius: 12px; padding: 14px 18px; margin: 1em 0 1.4em; border: 0; border-inline-start: 4px solid; font-size: var(--fs-sm); }
.callout > :last-child { margin-bottom: 0; }
.callout .c-title { display: block; margin-bottom: 3px; font-weight: 800; }
.callout.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.callout.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.callout.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.callout a { color: inherit; font-weight: 700; }

/* steps */
.steps { list-style: none; padding: 0; margin: 1em 0 1.4em; counter-reset: step; }
.steps li { position: relative; padding-inline-start: 48px; margin: 0 0 16px; min-height: 34px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; inset-inline-start: 0; top: 0; width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: var(--fs-sm);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* checklist */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-inline-start: 28px; }
.checklist li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .42em; width: 14px; height: 14px; background: var(--hl); clip-path: var(--star); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s ease; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.faq summary { cursor: pointer; padding: 15px 18px; font-weight: 700; list-style: none; display: flex; gap: 12px; align-items: flex-start; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; flex: 0 0 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; line-height: 1; }
.faq details[open] summary::before { content: "−"; background: var(--accent); color: var(--accent-ink); }
.faq .faq-a { padding: 0 18px 16px 54px; color: var(--ink-2); }
html[dir="rtl"] .faq .faq-a { padding: 0 54px 16px 18px; }
.faq .faq-a > :last-child { margin-bottom: 0; }

/* sources */
.sources { font-size: var(--fs-sm); }
.sources li { word-break: break-word; }

/* deadlines */
.deadlines { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.deadline {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; margin: 0;
  transition: border-color .15s ease;
}
.deadline:hover { border-color: var(--line-2); }
.deadline .d-date { text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 7px 4px; line-height: 1.1; }
.deadline .d-date b { display: block; font-size: 1.35rem; font-weight: 800; }
.deadline .d-date span { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; }
.deadline .d-main a { font-weight: 700; text-decoration: none; color: var(--ink); }
.deadline .d-main a:hover { color: var(--accent); }
.deadline .d-main small { display: block; color: var(--muted); }
.deadline .d-left { font-weight: 800; font-size: var(--fs-sm); color: var(--gold); white-space: nowrap; }
.deadline.soon .d-date { background: var(--bad-bg); color: var(--bad-ink); }
.deadline.soon .d-left { color: var(--red); }
:root[data-theme="dark"] .deadline.soon .d-left { color: #ff8a8a; }
.deadline.past { opacity: .62; }
@media (max-width: 520px) { .deadline { grid-template-columns: 56px 1fr; } .deadline .d-left { grid-column: 2; } }
.hero-art .deadline { grid-template-columns: 56px 1fr; background: var(--surface-2); border-color: transparent; }
.hero-art .deadline:hover { border-color: var(--line-2); }
.hero-art .deadline .d-date { background: var(--surface); }
.hero-art .deadline.soon .d-date { background: var(--bad-bg); }
.hero-art .deadline .d-left { grid-column: 2; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; align-items: center; }
.filters select, .filters input {
  min-height: 44px; padding: 8px 14px; font: inherit; font-size: var(--fs-sm); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
}
.filters select:focus, .filters input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.filters input[type="search"] { flex: 1 1 240px; }
.filters select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button, .seg a {
  min-height: 40px; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.seg button:hover, .seg a:hover { border-color: var(--accent); }
.seg button[aria-pressed="true"], .seg a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* forms (tools) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 700; font-size: var(--fs-sm); margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.result-box { background: var(--accent-soft); border: 0; border-inline-start: 4px solid var(--accent); border-radius: var(--r-md); padding: 18px; margin: 14px 0; }
.result-box .big { font-size: 2.3rem; font-weight: 800; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.meter { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--majorelle-300)); border-radius: 999px; }
.meter.warn > i { background: var(--saffron); }
.meter.bad > i { background: var(--red); }

/* tools: results */
.result-line { font-weight: 700; margin: 6px 0 12px; }
.wavg-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; margin-bottom: 8px; align-items: center; }
.wavg-row input { width: 100%; min-height: 42px; padding: 8px 10px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; }
.wavg-row .icon-btn, .tool-icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.orient-list { margin-bottom: 18px; }
.orient-card .card-title { display: block; color: var(--ink); text-decoration: none; }
.orient-card .card-title:hover { color: var(--accent); text-decoration: underline; }
.orient-card .card-meta .badge { white-space: normal; text-align: start; }
.orient-card.dim { opacity: .72; }
.check-items { list-style: none; padding: 0; margin: 0 0 8px; }
.check-items li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.check-items input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check-items label { cursor: pointer; }
.check-items input:checked + label { color: var(--muted); text-decoration: line-through; }
.plan-weeks { display: grid; gap: 12px; }
.plan-week { padding: 16px 18px; }
.plan-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.plan-week .checklist { margin: 10px 0; font-size: var(--fs-sm); }
.plan-bars { display: grid; gap: 6px; }
.plan-bar-label { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
@media (max-width: 620px) { .wavg-row { grid-template-columns: minmax(0, 1fr) 72px 72px 40px; } }
@media print { .plan-week { break-inside: avoid; } .check-items input { accent-color: #000; } }

/* QCM sample pages */
.qcm-list { list-style: none; padding: 0; margin: 0; counter-reset: q; }
.qcm-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin: 0 0 14px; box-shadow: var(--shadow-sm); }
.qcm-item .q { font-weight: 700; margin-bottom: 10px; }
.qcm-item .q::before { counter-increment: q; content: counter(q) ". "; color: var(--accent); }
.qcm-item ol.opts { list-style: upper-alpha; margin: 0 0 8px; }
html[dir="rtl"] .qcm-item ol.opts { list-style: arabic-indic; }
.qcm-item details { margin-top: 6px; }
.qcm-item details summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: var(--fs-sm); }
.qcm-item .answer { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); font-size: var(--fs-sm); }
.qcm-item .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }

/* ========================================================== home blocks */
/* families of concours: masonry columns, so short cards stay short */
.domain-grid { columns: 4 250px; column-gap: 16px; }
.domain-grid .domain-card { break-inside: avoid; margin-bottom: 16px; }
.domain-card { display: flex; flex-direction: column; }
.domain-card .card-top { margin-bottom: 12px; }
.domain-card .d-count { margin-inline-start: auto; font-size: var(--fs-xs); font-weight: 750; color: var(--hue, var(--accent)); background: color-mix(in srgb, var(--hue, var(--accent)) 10%, var(--surface)); padding: 2px 9px; border-radius: 999px; }
.domain-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.domain-links li { margin: 0; }
.domain-links a {
  display: inline-block; padding: 5px 11px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4;
  text-decoration: none; color: var(--ink-2); background: var(--surface-2); transition: background .15s ease, color .15s ease;
}
.domain-links a:hover { background: color-mix(in srgb, var(--hue, var(--accent)) 14%, var(--surface)); color: var(--ink); }

/* concours directory: family headings */
.group-title { display: flex; align-items: center; gap: 12px; }
.group-title > span:nth-child(2) { min-width: 0; }
.group-title .g-ico {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--hue, var(--accent)) 12%, var(--surface)); color: var(--hue, var(--accent));
}
.group-title .g-ico svg { width: 21px; height: 21px; fill: currentColor; }
.group-title .g-count { font-size: var(--fs-xs); font-weight: 750; color: var(--muted); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; letter-spacing: 0; }

/* practice subjects */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(215px, 100%), 1fr)); gap: 12px; }
.subject {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.subject:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--hue, var(--accent)) 45%, var(--line)); color: var(--ink); text-decoration: none; }
.subject .s-ico {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--hue, var(--accent)) 12%, var(--surface)); color: var(--hue, var(--accent)); font-weight: 800; font-size: .95rem;
}
:root[data-theme="dark"] .subject .s-ico { background: color-mix(in srgb, var(--hue, var(--accent)) 24%, var(--surface)); color: color-mix(in srgb, var(--hue, var(--accent)) 55%, #fff); }
.subject .s-ico svg { width: 21px; height: 21px; fill: currentColor; }
.subject .s-name { display: block; font-weight: 700; line-height: 1.3; }
.subject .s-count { display: block; font-size: var(--fs-xs); color: var(--muted); }

/* guide covers */
.guide-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.guide-card .cover {
  position: relative; height: 112px; display: grid; place-items: center; color: #fff;
  background: var(--pattern-dark), linear-gradient(135deg, var(--hue, var(--accent)), color-mix(in srgb, var(--hue, var(--accent)) 55%, var(--navy-900)));
}
.guide-card .cover::after { content: ""; position: absolute; width: 120px; height: 120px; inset-inline-end: -30px; bottom: -44px; clip-path: var(--star); background: rgba(255, 255, 255, .14); }
.guide-card .cover svg { width: 40px; height: 40px; fill: currentColor; position: relative; z-index: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2)); }
.guide-card .g-body { padding: 16px 18px 18px; }
.guide-card .card-title { display: block; }
.guide-card .card-sub { margin-top: 6px; }
a.guide-card.path-card::after { color: #fff; top: 14px; }

/* reassurance strip under the hero */
.trust { list-style: none; padding: 0; margin: -34px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; position: relative; z-index: 2; }
.trust li { margin: 0; }
.trust .t-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.trust .t-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--hue, var(--accent)) 12%, var(--surface)); color: var(--hue, var(--accent)); }
.trust .t-ico svg { width: 20px; height: 20px; fill: currentColor; }
.trust b { display: block; font-size: var(--fs-sm); line-height: 1.35; }
.trust span { display: block; font-size: var(--fs-xs); color: var(--muted); line-height: 1.45; margin-top: 2px; }
@media (max-width: 1000px) { .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .trust { gap: 10px; margin-top: -24px; }
  .trust .t-item { padding: 12px; gap: 10px; align-items: center; }
  .trust .t-ico { flex-basis: 34px; width: 34px; height: 34px; }
  .trust span { display: none; }
  .hero .btn-row .btn { flex: 1 1 100%; }
}

/* call-to-action band */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate; color: #fff; border-radius: var(--r-xl);
  padding: 34px clamp(20px, 4vw, 44px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px;
  background: var(--pattern-dark), radial-gradient(500px 300px at 100% 0%, rgba(245, 165, 36, .22), transparent 70%), linear-gradient(135deg, var(--navy-900), var(--majorelle-600));
  box-shadow: var(--shadow-lift);
}
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { color: #d5dcf2; margin: 0; max-width: 58ch; }
.cta-band .btn { background: var(--saffron); color: var(--navy-950); }
.cta-band .btn:hover { background: #ffb84d; color: var(--navy-950); }
.cta-band .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.cta-band .btn.ghost:hover { background: rgba(255, 255, 255, .12); }

/* ========================================================== footer */
.site-footer {
  margin-top: 56px; color: #a3b0d6; padding: 48px 0 calc(28px + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-sm);
  background: var(--pattern-dark), linear-gradient(180deg, var(--navy-900), var(--navy-950));
}
.site-footer a { color: #e3e8f7; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer .brand { color: #fff; }
.site-footer .brand span b { color: var(--saffron); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 28px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h2 { font-size: var(--fs-xs); color: #fff; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .12em; }
html[dir="rtl"] .footer-grid h2 { letter-spacing: 0; font-size: var(--fs-sm); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 7px 0; }
.footer-brand p { color: #9aa6c0; max-width: 40ch; margin-top: 12px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 30px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; color: #8d99b8; }

/* ========================================================== ads (AdSense slots, when used) */
.ad-slot { margin: 22px 0; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.ad-slot:empty { display: none; }

/* ========================================================== toast & sheet (shared) */
.toast {
  position: fixed; z-index: 90; inset-inline: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  margin: 0 auto; max-width: 480px; background: var(--navy-900); color: #eef1fa;
  border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-lift); font-size: var(--fs-sm);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ========================================================== print */
@media print {
  .site-header, .site-footer, .aside-sticky .cta-box, .no-print, .ad-slot, .search-wrap { display: none !important; }
  body { background: #fff; color: #000; }
  .breadcrumb::before, .page-head::before, .page-head::after { display: none; }
  .layout { grid-template-columns: 1fr; }
  a { color: #000; }
  .card, .fact, .table-wrap { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Formulas typeset by KaTeX on the QCM pages */
.math { unicode-bidi: isolate; }
.qcm-item .katex { font-size: 1.08em; }

/* Formulaire de contact (/contact/) */
.cform { position: relative; margin: 18px 0 26px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .cf-row { grid-template-columns: 1fr; } .cform { padding: 16px; } }
.cform .field label .cf-opt { display: inline; font-weight: 400; color: var(--muted); margin: 0; }
.cform textarea { min-height: 150px; resize: vertical; }
.cform .cf-hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; opacity: 0; }
.cf-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.cf-status { margin: 0; font-weight: 700; }
.cf-status.ok { color: var(--ok-ink); }
.cf-status.bad { color: var(--bad-ink); }

/* Android app badge (home page, footer): "bientôt sur Google Play" */
.app-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 7px 14px 7px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
.app-badge svg { width: 18px; height: 18px; fill: currentColor; color: var(--accent); }
.app-badge:hover { border-color: var(--accent); }
.app-badge.live { background: var(--accent); color: #fff; border-color: var(--accent); }
.app-badge.live svg { color: #fff; }
.site-footer .app-badge { margin-top: 6px; background: transparent; color: inherit; border-color: currentColor; opacity: .9; }
.site-footer .app-badge.live { background: var(--saffron); border-color: var(--saffron); color: var(--navy-950); opacity: 1; padding: 9px 16px 9px 12px; }
.site-footer .app-badge.live:hover { background: #ffb84d; text-decoration: none; color: var(--navy-950); }
.site-footer .app-badge.live svg { color: var(--navy-950); }

/* ========================================================== Android app funnel
   (scripts/lib/app-funnel.mjs). <html> gets is-android / is-ios /
   appbanner-off from the inline script of the head, before the first paint. */
html.is-ios .play-only { display: none !important; }
@media (max-width: 1000px) { .only-desktop { display: none !important; } }
html.is-android .only-desktop, html.is-ios .only-desktop { display: none !important; }
@media (min-width: 1001px) { .only-mobile { display: none !important; } }

/* store buttons: navy on light backgrounds, saffron on dark ones */
.btn.store-btn { background: var(--navy-950); color: #fff; }
.btn.store-btn:hover { background: var(--navy-800); color: #fff; box-shadow: 0 8px 20px rgba(11, 18, 41, .28); }
.btn.store-btn svg { color: var(--saffron); }
:root[data-theme="dark"] .btn.store-btn { background: var(--saffron); color: var(--navy-950); }
:root[data-theme="dark"] .btn.store-btn:hover { background: #ffb84d; color: var(--navy-950); }
:root[data-theme="dark"] .btn.store-btn svg { color: var(--navy-950); }
.hero .btn.store-btn, .app-band .btn.store-btn, .cta-box .btn.store-btn, .cta-band .btn.store-btn { background: var(--saffron); color: var(--navy-950); box-shadow: 0 8px 22px rgba(245, 165, 36, .28); }
.hero .btn.store-btn:hover, .app-band .btn.store-btn:hover, .cta-box .btn.store-btn:hover, .cta-band .btn.store-btn:hover { background: #ffb84d; color: var(--navy-950); }
.hero .btn.store-btn svg, .app-band .btn.store-btn svg, .cta-box .btn.store-btn svg, .cta-band .btn.store-btn svg { color: var(--navy-950); }
.hero .btn-row .btn.store-btn.alt { background: #fff; color: var(--navy-950); box-shadow: 0 8px 22px rgba(3, 7, 25, .3); }
.hero .btn-row .btn.store-btn.alt:hover { background: #eef1f8; }
.hero .btn-row .btn.store-btn.alt svg { color: var(--majorelle); }

/* header: saffron pill at the end of the navigation, first item of the phone menu */
.nav a.nav-app { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 8px; background: var(--saffron); color: var(--navy-950); font-weight: 750; box-shadow: 0 4px 14px rgba(245, 165, 36, .3); }
.nav a.nav-app:hover { background: #ffb84d; color: var(--navy-950); }
.nav a.nav-app svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
@media (min-width: 921px) and (max-width: 1140px) {
  .nav a { padding-inline: 10px; }
  .nav a.nav-app span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav a.nav-app { padding: 9px; }
}
@media (max-width: 920px) {
  .nav a.nav-app { order: -1; justify-content: center; margin: 0 0 8px; padding: 13px 14px; font-size: var(--fs-md); }
}

/* Android banner above the header (closed for 14 days with ×) */
.app-banner { display: none; background: var(--surface); border-bottom: 1px solid var(--line); }
html.is-android:not(.appbanner-off) .app-banner { display: block; }
.app-banner .ab-row { display: flex; align-items: center; gap: 10px; min-height: 64px; padding-block: 8px; }
.app-banner .ab-close { flex: none; width: 30px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0; }
.app-banner .ab-close:hover { background: var(--surface-2); color: var(--ink); }
.app-banner .app-ico { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 1px 4px rgba(14, 22, 48, .18); flex: none; }
.app-banner .ab-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.app-banner .ab-text b { font-size: var(--fs-sm); color: var(--ink); }
.app-banner .ab-text span { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.app-banner .ab-btn { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 6px 18px; border-radius: 999px; background: var(--saffron); color: var(--navy-950); font-weight: 800; font-size: var(--fs-sm); text-decoration: none; }
.app-banner .ab-btn:hover { background: #ffb84d; color: var(--navy-950); }

/* icons, QR codes, screenshots */
.app-ico { border-radius: 22%; flex: none; display: block; }
.app-qr { display: block; background: #fff; padding: 6px; border-radius: 10px; image-rendering: pixelated; }
.app-shot { display: block; width: 100%; height: auto; border-radius: 26px; }

/* card of the side column (desktop) */
.app-card.aside-app { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--saffron); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.aside-app .ac-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.aside-app .ac-top h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.aside-app .app-ico { width: 48px; height: 48px; box-shadow: 0 1px 4px rgba(14, 22, 48, .18); }
.aside-app p { font-size: var(--fs-sm); color: var(--ink-2); margin: 0 0 12px; }
.aside-app .ac-qr { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.aside-app .ac-qr .app-qr { border: 1px solid var(--line); }
.aside-app .ac-qr small { color: var(--muted); line-height: 1.4; }

/* card in the right column of the page header (desktop): in view at once */
@media (min-width: 1001px) {
  /* the card spans the text rows plus a flexible row that takes its extra height */
  .page-head.with-app { display: grid; grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: repeat(4, auto) 1fr; column-gap: 44px; align-items: start; }
  .page-head.with-app > * { grid-column: 1; }
  .page-head.with-app > .head-app { grid-column: 2; grid-row: 1 / 6; align-self: start; margin-top: 6px; }
  .page-head.with-app > .facts { grid-column: 1 / -1; grid-row: 6; }
}

/* card inside the content */
.app-card.inline-app {
  display: flex; align-items: flex-start; gap: 16px; margin: 28px 0; padding: 18px;
  border: 1px solid color-mix(in srgb, var(--saffron) 45%, var(--line)); border-radius: var(--r-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--saffron) 13%, var(--surface)), var(--surface) 70%);
  box-shadow: var(--shadow-sm);
}
.inline-app .app-ico { width: 56px; height: 56px; box-shadow: 0 2px 8px rgba(14, 22, 48, .2); }
.inline-app .ia-body { flex: 1; min-width: 0; }
.inline-app h3 { margin: 0 0 4px; font-size: 1.08rem; }
.inline-app p { margin: 0 0 12px; color: var(--ink-2); font-size: var(--fs-sm); }
.inline-app .ia-more { font-weight: 700; font-size: var(--fs-sm); }
.inline-app .ia-qr .app-qr { border: 1px solid var(--line); }
@media (max-width: 480px) { .app-card.inline-app { flex-direction: column; gap: 12px; } }
.qcm-list > li.qcm-app { list-style: none; }
.qcm-list > li.qcm-app .inline-app { margin: 4px 0 18px; }

/* line inside the "practice" box of a concours page */
.practice-app { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: var(--fs-sm); }
.practice-app svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.cta-box .practice-app { color: #d5dcf2; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 12px; }
.cta-box .practice-app a { color: var(--saffron-300); font-weight: 750; }

/* home page: pill above the title of the hero */
.app-pill { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 5px 14px 5px 6px; border-radius: 999px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font-size: var(--fs-sm); font-weight: 650; text-decoration: none; }
.app-pill:hover { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.app-pill b { background: var(--saffron); color: var(--navy-950); border-radius: 999px; padding: 2px 10px; font-size: var(--fs-xs); font-weight: 800; }
.app-pill span:only-of-type { padding-inline-start: 6px; }
.app-pill svg { width: 16px; height: 16px; fill: currentColor; }
html[dir="rtl"] .app-pill svg { transform: scaleX(-1); }

/* big band (home page, practice page, application/) */
.app-band {
  position: relative; isolation: isolate; overflow: hidden; color: #fff; margin: 0; padding: 56px 0;
  background: radial-gradient(560px 380px at 95% 10%, rgba(245, 165, 36, .2), transparent 70%), var(--pattern-dark), linear-gradient(150deg, var(--navy-950), var(--navy-900) 50%, var(--majorelle-600));
}
.app-band .ab-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 40px; align-items: center; }
.app-band .eyebrow { color: var(--saffron-300); }
.app-band h2 { color: #fff; margin: 0 0 18px; font-size: clamp(1.5rem, 3.4vw, 2.2rem); max-width: 22ch; }
.app-band .ab-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.app-band .ab-list li { display: flex; gap: 10px; align-items: flex-start; color: #d5dcf2; }
.app-band .ab-list li strong { color: #fff; }
.app-band .ab-list svg { width: 20px; height: 20px; fill: var(--saffron); flex: none; margin-top: 3px; }
.app-band .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.app-band .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.app-band .ab-note { margin: 14px 0 0; color: #9aa6c0; font-size: var(--fs-sm); }
.app-band .ab-art { position: relative; display: flex; justify-content: center; }
.app-band .phone { width: min(270px, 70vw); border-radius: 28px; padding: 0; box-shadow: 0 30px 70px rgba(3, 7, 25, .55); border: 1px solid rgba(255, 255, 255, .14); background: #0b1229; overflow: hidden; }
.app-band .phone .app-shot { border-radius: 27px; }
.app-band .ab-qr { position: absolute; inset-inline-start: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 140px; padding: 10px 10px 8px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lift); text-align: center; }
.app-band .ab-qr .app-qr { padding: 0; }
.app-band .ab-qr small { color: #33405f; font-size: .72rem; line-height: 1.3; }
@media (max-width: 900px) {
  .app-band { padding: 40px 0 44px; }
  .app-band .ab-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .app-band .phone { width: min(240px, 66vw); }
}

/* application/: hero, features, screenshots */
.app-hero .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
@media (max-width: 900px) {
  .app-hero .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .app-hero .ah-art .phone { width: min(230px, 62vw); }
}
.app-hero h1 { max-width: 19ch; }
.app-hero .btn.ghost svg { transform: rotate(90deg); }
.app-hero .ah-art { position: relative; display: flex; justify-content: center; }
.app-hero .ah-art .phone { width: min(290px, 72vw); border-radius: 30px; box-shadow: 0 30px 70px rgba(3, 7, 25, .55); border: 1px solid rgba(255, 255, 255, .14); overflow: hidden; background: #0b1229; }
.app-hero .ah-art .phone .app-shot { border-radius: 29px; }
.app-hero .ah-id { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.app-hero .ah-id .app-ico { width: 72px; height: 72px; box-shadow: 0 10px 30px rgba(3, 7, 25, .45); }
.app-hero .ah-id b { display: block; font-size: 1.15rem; color: #fff; }
.app-hero .ah-id span { color: #aeb9d9; font-size: var(--fs-sm); }
.app-facts { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.app-facts li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #e3e8f7; font-size: var(--fs-sm); font-weight: 650; }
.app-facts svg { width: 16px; height: 16px; fill: var(--saffron); }
.ios-note { display: none; margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font-size: var(--fs-sm); }
html.is-ios .ios-note { display: block; }
.app-qr-row { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); max-width: 440px; }
.app-qr-row p { margin: 0; color: #c9d2ea; font-size: var(--fs-sm); }
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 230px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; margin: 0; overscroll-behavior-x: contain; }
.shots figure { margin: 0; scroll-snap-align: start; }
.shots .app-shot { border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.shots figcaption { margin-top: 8px; font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2); text-align: center; }

@media print { .app-banner, .app-card, .app-band, .app-pill, .nav-app { display: none !important; } }

/* ========================================================== orientation & engagement (engage.js)
   Home hero paths, "Quiz express", recently viewed, section bar on long
   pages, end-of-page next steps. */

/* hero: one search, four clear ways in */
.hero-paths { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.hero-paths li { margin: 0; }
.hero-paths a {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: #fff;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.hero-paths a:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 194, 102, .55); color: #fff; text-decoration: none; }
.hero-paths a:active { transform: scale(.98); }
.hero-paths .hp-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(245, 165, 36, .16); color: var(--saffron-300); }
.hero-paths .hp-ico svg { width: 20px; height: 20px; fill: currentColor; }
.hero-paths b { display: block; font-size: .98rem; line-height: 1.25; }
.hero-paths small { display: block; color: #aeb9d9; font-size: var(--fs-xs); line-height: 1.35; margin-top: 2px; }
.hero-paths a.hp-main { background: var(--saffron); border-color: var(--saffron); color: var(--navy-950); }
.hero-paths a.hp-main:hover { background: #ffb84d; color: var(--navy-950); }
.hero-paths a.hp-main .hp-ico { background: rgba(11, 18, 41, .12); color: var(--navy-950); }
.hero-paths a.hp-main small { color: rgba(11, 18, 41, .72); }
@media (max-width: 420px) { .hero-paths a { padding: 10px 11px; gap: 9px; } .hero-paths .hp-ico { flex-basis: 32px; width: 32px; height: 32px; } .hero-paths small { display: none; } .hero-paths a { min-height: 56px; } }
.hero-compact { padding: 44px 0 52px; }
@media (max-width: 900px) { .hero-compact { padding: 26px 0 32px; } .hero-compact .lead { font-size: 1rem; margin-bottom: 0; } .hero-compact .big-search { margin: 16px 0 14px; } }
.hero-compact .stat-row { margin-top: 22px; }
@media (max-width: 900px) { .hero-compact .stat-row { display: none; } }
@media (max-width: 900px) { .hero-compact .hero-art { padding: 16px; } }
@media (max-width: 1000px) { html:has(.sec-bar:not([hidden])) { scroll-padding-top: calc(var(--header-h) + 58px); } }

/* recently viewed (filled by engage.js) */
.recent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.recent-row[hidden] { display: none; }
.rc-label { font-size: var(--fs-sm); color: #c9d2ea; font-weight: 650; }
.rc-chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 700; text-decoration: none; background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.rc-chip::after { content: "→"; margin-inline-start: 6px; color: var(--saffron-300); }
html[dir="rtl"] .rc-chip::after { content: "←"; }
.rc-chip:hover { background: rgba(255, 255, 255, .2); color: #fff; text-decoration: none; }

/* Quiz express */
.qx {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-xl); padding: clamp(18px, 3.5vw, 30px);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lift);
}
.qx::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--saffron), var(--majorelle), #20a066); }
.qx::after { content: ""; position: absolute; z-index: -1; width: 200px; height: 200px; inset-inline-end: -60px; top: -70px; clip-path: var(--star); background: color-mix(in srgb, var(--saffron) 14%, transparent); }
.qx-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center; }
.qx-intro[hidden], .qx-stage[hidden] { display: none; }
.qx h2 { margin: 4px 0 6px; font-size: clamp(1.3rem, 3.2vw, 1.75rem); }
.qx-lead { color: var(--ink-2); margin: 0 0 14px; max-width: 58ch; }
.qx-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.qx-pick button {
  font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.qx-pick button:hover { border-color: var(--accent); color: var(--accent); }
.qx-pick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qx-go { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.qx-go .btn { min-height: 54px; padding-inline: 26px; font-size: 1.05rem; background: var(--saffron); color: var(--navy-950); box-shadow: 0 10px 26px rgba(245, 165, 36, .3); }
.qx-go .btn:hover { background: #ffb84d; color: var(--navy-950); }
.qx-go small { color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 760px) { .qx-intro { grid-template-columns: minmax(0, 1fr); } .qx-go { align-items: stretch; } .qx-go .btn { width: 100%; } }
.qx-loading { margin: 6px 0; color: var(--muted); font-weight: 650; }
.qx-loading::before { content: ""; display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); vertical-align: -3px; margin-inline-end: 10px; animation: qx-spin .8s linear infinite; }
@keyframes qx-spin { to { transform: rotate(360deg); } }
.qx-error p { color: var(--bad-ink); }
.qx-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-sm); }
.qx-sub { font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.qx-streak { font-weight: 750; color: var(--gold); }
.qx-count { margin-inline-start: auto; color: var(--muted); font-weight: 700; }
.qx-bar { height: 6px; border-radius: 6px; background: var(--surface-2); margin: 12px 0 16px; overflow: hidden; }
.qx-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--majorelle), var(--saffron)); transition: width .3s ease; }
.qx-lang { display: inline-block; font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 8px; margin-bottom: 6px; }
.qx-q { font-size: clamp(1.05rem, 2.4vw, 1.2rem); font-weight: 700; line-height: 1.5; margin: 0 0 14px; color: var(--ink); }
.qx-opts { display: grid; gap: 10px; }
.qx-opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: start; font: inherit; color: var(--ink); cursor: pointer;
  min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface);
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.qx-opt:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.qx-opt:active:not([disabled]) { transform: scale(.99); }
.qx-opt[disabled] { cursor: default; }
.qx-letter { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-2); color: var(--ink-2); }
.qx-txt { padding-top: 3px; line-height: 1.45; }
.qx-opt.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.qx-opt.ok .qx-letter { background: var(--ok-line); color: #fff; }
.qx-opt.ko { border-color: var(--bad-line); background: var(--bad-bg); }
.qx-opt.ko .qx-letter { background: var(--bad-line); color: #fff; }
.qx-opt[disabled]:not(.ok):not(.ko) { opacity: .62; }
.qx-fb { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border-inline-start: 4px solid; animation: qx-in .25s ease; }
.qx-fb.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.qx-fb.ko { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.qx-fb strong { display: block; font-size: 1.02rem; }
.qx-fb p { margin: 6px 0 0; color: var(--ink); line-height: 1.55; }
.qx-fb .qx-corr { font-weight: 650; }
@keyframes qx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.qx-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.qx-actions .btn { min-width: 200px; }
@media (max-width: 560px) { .qx-actions .btn { width: 100%; } }
.qx-end { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 26px; align-items: center; animation: qx-in .3s ease; }
@media (max-width: 560px) { .qx-end { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } .qx-end .btn-row { justify-content: center; } }
.qx-ring {
  --p: 0; width: 124px; height: 124px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%), conic-gradient(var(--saffron) calc(var(--p) * 1%), var(--surface-2) 0);
}
.qx-ring b { font-size: 2.4rem; line-height: 1; font-weight: 800; color: var(--ink); }
.qx-ring span { font-size: .95rem; color: var(--muted); font-weight: 700; }
.qx-msg { font-size: 1.08rem; font-weight: 700; margin: 0 0 4px; }
.qx-best { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 12px; }
.qx-end .btn-row { margin-top: 10px; }
.qx-more { margin-top: 8px; }
.section.qx-section { padding-top: 34px; }
@media (max-width: 900px) { .section.qx-section { padding-top: 22px; } }
.prose .qx { margin: 2.2em 0; }
.prose .qx h2::before { display: none; }
.prose .qx h2 { margin-top: 4px; }

/* domains as one compact row of links */
.dom-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.dom-chips a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border-radius: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .15s ease;
}
html[dir="rtl"] .dom-chips a { padding: 9px 10px 9px 14px; }
.dom-chips a:hover { border-color: color-mix(in srgb, var(--hue, var(--accent)) 50%, var(--line)); transform: translateY(-1px); color: var(--ink); text-decoration: none; }
.dom-chips .dc-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--hue, var(--accent)) 12%, var(--surface)); color: var(--hue, var(--accent)); }
.dom-chips .dc-ico svg { width: 17px; height: 17px; fill: currentColor; }
.dom-chips .dc-n { color: var(--muted); font-weight: 650; font-size: var(--fs-xs); }

/* phones: compact cards so the home page stays short */
@media (max-width: 620px) {
  .home-compact .grid.cols-3, .home-compact .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-compact .path-card .card-sub, .home-compact .path-card .card-meta { display: none; }
  .home-compact .card.path-card { padding: 14px; }
  .home-compact .card .card-top { align-items: flex-start; flex-direction: column; gap: 8px; margin: 0; }
  .home-compact .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-compact .subject { padding: 10px; gap: 8px; }
  .home-compact .subject .s-ico { flex-basis: 32px; width: 32px; height: 32px; }
  .home-compact .section { padding: 30px 0; }
}

/* end of a fiche: what to do next */
.next-steps { margin: 2.4em 0 0; padding: 22px; border-radius: var(--r-xl); background: var(--band-bg); border: 1px solid var(--line); }
.next-steps h2 { margin-top: 0 !important; }
.next-steps h2::before { display: none !important; }
.next-steps ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .next-steps ul { grid-template-columns: minmax(0, 1fr); } }
.next-steps li { margin: 0; }
.next-steps a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; min-height: 58px; }
.next-steps a:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.next-steps .ns-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.next-steps .ns-ico svg { width: 19px; height: 19px; fill: currentColor; }
.next-steps small { display: block; color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }

/* long pages: current section under the header + reading progress */
.sec-bar { position: absolute; inset-inline: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 6px 16px rgba(14, 22, 48, .08); }
.sec-bar[hidden] { display: none; }
.sec-row { display: flex; align-items: center; min-height: 44px; }
.sec-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--ink); text-align: start;
}
.sec-lab { flex: none; font-size: var(--fs-xs); font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
html[dir="rtl"] .sec-lab { letter-spacing: 0; text-transform: none; }
.sec-cur { flex: 1; min-width: 0; font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-btn::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 6px 0; transition: transform .15s ease; }
.sec-bar.open .sec-btn::after { transform: rotate(-135deg); margin-top: 4px; }
.sec-menu { list-style: none; margin: 0; padding: 6px var(--pad) 12px; max-height: 60vh; overflow-y: auto; border-top: 1px solid var(--line); counter-reset: sec; }
.sec-menu[hidden] { display: none; }
.sec-menu li { margin: 0; counter-increment: sec; }
.sec-menu a { display: flex; gap: 10px; padding: 10px 4px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); }
.sec-menu a::before { content: counter(sec); flex: 0 0 22px; color: var(--muted); font-weight: 800; font-size: .85em; }
.sec-menu a[aria-current] { color: var(--accent); }
.sec-prog { height: 3px; background: transparent; }
.sec-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--saffron), var(--majorelle)); transform: scaleX(0); transform-origin: left center; }
html[dir="rtl"] .sec-prog i { transform-origin: right center; }
.toc a[aria-current] { color: var(--accent); font-weight: 750; }
@media (min-width: 1001px) {
  .sec-bar { background: transparent; border: 0; box-shadow: none; }
  .sec-row, .sec-menu { display: none !important; }
}

@media print { .qx, .sec-bar, .next-steps, .recent-row { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .qx-fb, .qx-end { animation: none; } .qx-bar i { transition: none; } }
.hero-note { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; font-size: var(--fs-sm); color: #c9d2ea; }
.hero-note span { display: inline-flex; align-items: center; gap: 5px; }
.hero-note svg { width: 16px; height: 16px; fill: #34c17f; }

/* header: language switch next to the search button (every page, every screen) */
.hdr-lang {
  width: auto; padding: 0 14px; margin-inline-end: 4px; gap: 0; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line-2); font-weight: 750; font-size: var(--fs-sm); line-height: 1; white-space: nowrap;
}
.hdr-lang:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.hdr-lang[lang="ar"] { font-family: var(--font-ar); font-size: .95rem; }
.hdr-lang .ls-short { display: none; }
@media (max-width: 480px) {
  .hdr-lang { padding: 0; margin-inline-end: 2px; }
  .hdr-lang .ls-long { display: none; }
  .hdr-lang .ls-short { display: inline; font-size: 1.05rem; }
  .hdr-lang[lang="fr"] .ls-short { font-size: .85rem; letter-spacing: .02em; }
}
/* phones: four header buttons and the brand on one line */
@media (max-width: 420px) {
  .site-header .bar { gap: 6px; }
  .site-header .brand { gap: 8px; }
  .site-header .brand svg { width: 32px; height: 32px; flex-basis: 32px; }
  .site-header .brand span { font-size: 1rem; white-space: nowrap; }
  .hdr-tools .hdr-btn { width: 38px; height: 38px; }
  .hdr-tools { gap: 1px; }
}
@media (max-width: 379px) { .site-header .brand span { white-space: normal; } }

/* WhatsApp share button (generic chat icon, WhatsApp green) */
.btn.wa { background: #1fa855; color: #fff; border-color: transparent; }
.btn.wa:hover { background: #178a45; color: #fff; box-shadow: 0 8px 20px rgba(31, 168, 85, .28); }
.page-head .updated .btn.wa { background: #1fa855; color: #fff; }
/* deadlines: calendar buttons */
.d-cal { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
