/* Sabeel : page d'annonce. Jetons tirés de l'appli (voir design/BRAND-EXTRACT.md).
   Aucune valeur hexadécimale en dehors de ce bloc de jetons. */
:root {
  color-scheme: light dark;

  /* Couleurs de l'appli (palettes.dart, tokens.json du kit Paper v2) */
  --bg: light-dark(#FAF1E8, #03232B);
  --surface: light-dark(#FFF9F2, #062A33);
  --surface-2: light-dark(#FFFCF8, #082D36);
  --line: light-dark(#EBDDCC, #1B4A54);
  --sand: light-dark(#E7C8AD, #23545E);
  --ink: light-dark(#12363C, #FAF1E8);
  --ink-2: light-dark(#3D5C60, #BFD6D3);
  --brand: light-dark(#02596D, #80BDBA);
  --brand-2: light-dark(#0F6E75, #2CAAA5);
  --on-brand: light-dark(#FFFFFF, #0B2A30);
  --brand-soft: light-dark(#D7EAE8, #164A55);
  --on-brand-soft: light-dark(#023A47, #D3ECEA);
  --btn-top: light-dark(#0F6E75, #43C2BC);
  --btn-bottom: light-dark(#02596D, #2CAAA5);
  --gold: light-dark(#F3CD6C, #F3CD6C);
  --gold-ink: light-dark(#875409, #FFE09B);
  --error: light-dark(#B51F29, #FF8A8A);
  --success: light-dark(#16803C, #5EDC8F);
  --shadow-rgb: light-dark(#674C30, #00161D);
  --phone: light-dark(#0B2A30, #00161D);
  --phone-rim: light-dark(#023A47, #23545E);
  --logo: light-dark(#111111, #FFFFFF);
  --scene-on-btn: light-dark(#023A47, #0B2A30);
  --field-ink: light-dark(#12363C, #0B2A30);
  --field-hint: light-dark(#3D5C60, #3D5C60);
  --scene-err: light-dark(#FFD0D0, #FF8A8A);
  --scene-ok: light-dark(#C9F2D8, #5EDC8F);

  /* Scène : la grande zone de couleur (bleu canard de l'appli) */
  --scene-a: light-dark(#02596D, #0A4853);
  --scene-b: light-dark(#0F6E75, #1A6069);
  --scene-ink: light-dark(#FAF1E8, #FAF1E8);
  --scene-ink-2: color-mix(in oklab, var(--scene-ink) 86%, var(--scene-a));
  --scene-line: color-mix(in oklab, var(--scene-ink) 34%, var(--scene-a));

  /* Vagues de papier (tokens.json wave1..4) */
  --wave-1: light-dark(#E7C8AD, #0A505C);
  --wave-2: light-dark(#80BDBA, #397D83);
  --wave-3: light-dark(#0F6E75, #02596D);
  --wave-4: light-dark(#F3D5AF, #E7C8AD);

  /* Dérivées (color-mix seulement) */
  --shadow-soft: 0 30px 50px -30px color-mix(in srgb, var(--shadow-rgb) 55%, transparent);
  --shadow-card: 0 5px 12px color-mix(in srgb, var(--shadow-rgb) 14%, transparent);
  --ring: 0 0 0 1px var(--line);
  --header-bg: color-mix(in srgb, var(--bg) 86%, transparent);

  /* Formes (Rayon de l'appli : 14 / 20 / 24 / 32 / pilule) */
  --r-field: 14px;
  --r-tile: 20px;
  --r-card: 24px;
  --r-scene: clamp(28px, 4vw, 40px);
  --r-pill: 999px;

  /* Espaces (grille de 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(48px, 7vw, 112px);
  --wrap: 1180px;

  /* Typographie */
  --font-text: "Nunito", "Nunito Fallback", system-ui, sans-serif;
  --font-display: var(--font-text);
  --fs-h1: clamp(2.375rem, 1.6rem + 3.6vw, 4.25rem);
  --fs-h2: clamp(1.75rem, 1.35rem + 1.9vw, 2.75rem);
  --fs-h3: 1.375rem;
  --fs-lead: clamp(1.125rem, 1.08rem + .25vw, 1.1875rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --lh-title: 1.08;
  --lh-body: 1.55;
  --track-title: -0.02em;

  /* Mouvement (Anim de l'appli : 150 / 250 / 400 ms) */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 150ms;
  --t-mid: 250ms;
  --t-slow: 700ms;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Écritures : chaque langue a sa police et son rythme */
:root:lang(ar), :root:lang(fa) {
  --font-text: "Noto Sans Arabic", "Nunito", system-ui, sans-serif;
  --lh-title: 1.36; --lh-body: 1.8; --track-title: 0;
  --fs-body: 1.125rem; --fs-lead: clamp(1.1875rem, 1.1rem + .3vw, 1.3125rem); --fs-small: 1rem;
}
:root:lang(ur) {
  --font-text: "Noto Nastaliq Urdu", "Nunito", serif;
  --lh-title: 1.9; --lh-body: 2.15; --track-title: 0;
  --fs-h1: clamp(2rem, 1.4rem + 2.8vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
}
:root:lang(bn) {
  --font-text: "Noto Sans Bengali", "Nunito", system-ui, sans-serif;
  --lh-title: 1.3; --lh-body: 1.7; --track-title: 0;
}
:root:lang(ru) { --track-title: -0.01em; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-block-start: 88px; scrollbar-color: var(--sand) var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: var(--fs-body); line-height: var(--lh-body);
  accent-color: var(--brand); caret-color: var(--brand);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: var(--brand); color: var(--on-brand); }
img, svg { display: block; max-inline-size: 100%; }
img { block-size: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: var(--lh-title); letter-spacing: var(--track-title); text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
p { text-wrap: pretty; hyphens: auto; hyphenate-limit-chars: 10 4 4; overflow-wrap: break-word; }
a { color: var(--brand); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
button, input, textarea { font: inherit; color: inherit; }
bdi { unicode-bidi: isolate; }
.vh { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { inline-size: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.lead { font-size: var(--fs-lead); color: var(--ink-2); max-inline-size: 60ch; }
.icon { inline-size: 24px; block-size: 24px; fill: currentColor; flex: none; }
.flip-rtl:dir(rtl) { transform: scaleX(-1); }

.skip { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 100; padding: 12px 20px; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand); font-weight: 700; text-decoration: none; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* En-tête collant, translucide */
.top { position: sticky; inset-block-start: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent); }
.top-in { display: flex; align-items: center; gap: var(--s-4); min-block-size: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; min-block-size: 44px; }
.brand .mark { inline-size: 26px; block-size: 26px; fill: var(--logo); border-radius: 3px; }
.nav { margin-inline-start: auto; }
.nav ul { display: flex; gap: clamp(2px, .8vw, 8px); }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-block-size: 44px; padding-inline: 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: var(--fs-small); line-height: 1.2; text-align: center; border-radius: var(--r-pill); transition: color var(--t-fast), background-color var(--t-fast); }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--sand) 35%, transparent); }
.nav a[aria-current="page"] { color: var(--on-brand-soft); background: var(--brand-soft); }
/* « Comment ça fonctionne » : bien visible, toujours cerné */
.nav a.nav-how { color: var(--brand); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--brand); }
.nav a.nav-how:hover { background: var(--brand-soft); color: var(--on-brand-soft); }
.nav a.nav-how[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.top-cta { flex: none; }
@media (max-width: 899px) {
  /* Téléphone : en haut le nom, « Me prévenir » et la langue ; le menu en barre fixe en bas, toujours à portée de pouce */
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .top-in { gap: var(--s-2); }
  .top-cta { margin-inline-start: auto; }
  .nav { position: fixed; z-index: 55; inset-inline: 0; inset-block-end: 0; margin: 0; padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); background: var(--surface-2); box-shadow: 0 -1px 0 var(--line), 0 -10px 24px -16px color-mix(in srgb, var(--shadow-rgb) 40%, transparent); }
  .nav ul { gap: 6px; }
  .nav li { flex: 1 1 0; min-inline-size: 0; }
  .nav a { inline-size: 100%; min-block-size: 48px; padding-inline: 6px; font-size: .875rem; }
  .nav a.nav-how { box-shadow: inset 0 0 0 1.5px var(--brand); }
  .lang summary { padding-inline: 10px 6px; }
  .lang-name { display: none; }
  body { padding-block-end: 72px; }
}

/* Sélecteur de langue */
.lang { position: relative; }
.lang summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding-inline: 12px 8px; border-radius: var(--r-pill); box-shadow: var(--ring); background: var(--surface); cursor: pointer; font-weight: 600; font-size: var(--fs-small); line-height: 1.2; user-select: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { box-shadow: 0 0 0 1px var(--sand); }
.lang summary .icon { inline-size: 20px; block-size: 20px; color: var(--brand); }
.lang summary .chev { transition: transform var(--t-mid) var(--ease-out); }
.lang[open] summary .chev { transform: rotate(180deg); }
.lang-list { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 60; inline-size: max-content; max-inline-size: min(92vw, 420px); padding: 8px; border-radius: var(--r-tile); background: var(--surface-2); box-shadow: var(--ring), var(--shadow-soft); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.lang-list a { display: flex; align-items: center; min-block-size: 44px; padding-inline: 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-family: "Nunito", "Noto Sans Arabic", "Noto Nastaliq Urdu", "Noto Sans Bengali", system-ui, sans-serif; font-size: 1rem; line-height: 1.2; }
.lang-list a:hover { background: var(--brand-soft); color: var(--on-brand-soft); }
.lang-list a[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--brand); font-weight: 700; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 56px; padding: 10px 28px; border: 0; border-radius: var(--r-pill); font-weight: 700; font-size: 1.125rem; line-height: 1.2; text-decoration: none; cursor: pointer; text-align: center; transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-mid) var(--ease-out), filter var(--t-fast); }
.btn-primary { background: linear-gradient(var(--btn-top), var(--btn-bottom)); color: var(--on-brand); box-shadow: 0 4px 8px color-mix(in srgb, var(--shadow-rgb) 22%, transparent), inset 0 1px 0 color-mix(in srgb, var(--on-brand) 22%, transparent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -4px color-mix(in srgb, var(--shadow-rgb) 30%, transparent), inset 0 1px 0 color-mix(in srgb, var(--on-brand) 22%, transparent); }
.btn-primary:active { transform: translateY(1px); filter: brightness(.96); }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--sand); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--brand); }
.btn-small { min-block-size: 44px; padding: 6px 18px; font-size: 1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .spin { display: none; inline-size: 18px; block-size: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent); border-block-start-color: currentColor; animation: spin .8s linear infinite; }
.btn.is-loading .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.pill { display: inline-flex; align-items: center; gap: 8px; min-block-size: 32px; padding: 4px 14px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--on-brand-soft); font-weight: 700; font-size: var(--fs-small); line-height: 1.3; }
.pill::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: currentColor; }

/* Formulaires */
.form { display: grid; gap: var(--s-3); max-inline-size: 560px; inline-size: 100%; }
.field-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.field-row .input { flex: 1 1 200px; min-inline-size: 0; }
.field-row .btn { flex: 0 1 auto; }
.input, .textarea { inline-size: 100%; min-block-size: 56px; padding: 14px 20px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 1px var(--sand); font-size: 1.0625rem; transition: box-shadow var(--t-fast); }
.textarea { border-radius: var(--r-tile); min-block-size: 140px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: color-mix(in oklab, var(--ink-2) 86%, var(--surface-2)); opacity: 1; }
.input:hover, .textarea:hover { box-shadow: 0 0 0 1.5px var(--brand); }
.input:focus-visible, .textarea:focus-visible { outline: none; box-shadow: 0 0 0 2.5px var(--brand); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--error); }
.input:dir(rtl)[type="email"] { direction: ltr; text-align: end; }
.label { font-weight: 600; font-size: var(--fs-small); }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: var(--fs-small); line-height: 1.45; color: var(--ink-2); cursor: pointer; padding-block: 4px; min-block-size: 44px; }
.check input { inline-size: 22px; block-size: 22px; margin: 1px 0 0; }
.note { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.45; }
.msg { font-size: var(--fs-small); font-weight: 600; line-height: 1.4; min-block-size: 1.4em; }
.msg[data-kind="err"] { color: var(--error); }
.msg[data-kind="ok"] { color: var(--success); }
.msg:empty { display: none; }

/* Sur une scène de couleur : tout se teinte depuis la scène */
.on-scene { color: var(--scene-ink); }
.on-scene .lead, .on-scene .note, .on-scene .check { color: var(--scene-ink-2); }
.on-scene a { color: var(--scene-ink); }
.on-scene :focus-visible { outline-color: var(--gold); }
.on-scene .pill { background: color-mix(in oklab, var(--scene-ink) 16%, var(--scene-a)); color: var(--scene-ink); }
.on-scene .btn-primary { background: var(--scene-ink); color: var(--scene-on-btn); box-shadow: 0 4px 10px color-mix(in srgb, var(--shadow-rgb) 40%, transparent); }
.on-scene .input { background: color-mix(in oklab, var(--scene-ink) 96%, var(--scene-a)); color: var(--field-ink); box-shadow: none; caret-color: var(--scene-on-btn); }
.on-scene .input::placeholder { color: var(--field-hint); }
.on-scene .input:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
.on-scene .check input { accent-color: var(--gold); }
.on-scene .msg[data-kind="err"] { color: var(--scene-err); }
.on-scene .msg[data-kind="ok"] { color: var(--scene-ok); }
.on-scene ::selection { background: var(--scene-ink); color: var(--scene-a); }

/* Téléphone et captures */
.phone { position: relative; inline-size: min(100%, var(--phone-w, 300px)); aspect-ratio: 390 / 844; padding: 9px; border-radius: 13.5% / 6.3%; background: var(--phone); box-shadow: 0 0 0 1px var(--phone-rim), 0 40px 60px -34px color-mix(in srgb, var(--shadow-rgb) 70%, transparent), 0 14px 24px -14px color-mix(in srgb, var(--shadow-rgb) 40%, transparent); }
.phone-screen { position: relative; block-size: 100%; border-radius: 11.4% / 5.3%; overflow: hidden; background: var(--bg); }
.phone-screen img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-dark { display: block; }
  :root:not([data-theme="light"]) .shot-light { display: none; }
}
:root[data-theme="dark"] .shot-dark { display: block; }
:root[data-theme="dark"] .shot-light { display: none; }

/* Pied de page */
.foot { padding-block: var(--s-7); color: var(--ink-2); font-size: var(--fs-small); box-shadow: 0 -1px 0 var(--line); }
.foot-in { display: grid; gap: var(--s-5); }
.signature { font-family: var(--font-big, var(--font-text)); font-weight: 700; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); line-height: 1.15; color: var(--ink); letter-spacing: -0.015em; text-align: start; unicode-bidi: isolate; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); }
.foot .logo { block-size: 64px; inline-size: auto; margin: -14px; }
.foot .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .foot .logo-dark { display: block; } :root:not([data-theme="light"]) .foot .logo-light { display: none; } }
:root[data-theme="dark"] .foot .logo-dark { display: block; }
:root[data-theme="dark"] .foot .logo-light { display: none; }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); margin-inline-start: auto; }
.foot ul a { display: inline-flex; align-items: center; min-block-size: 44px; color: var(--ink-2); }
.foot ul span { display: inline-block; padding-block: 10px; color: var(--ink-2); }
.foot ul a:hover { color: var(--ink); }
a[aria-disabled="true"] { cursor: default; opacity: .7; text-decoration-style: dotted; }

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

/* Vagues de papier découpé (les mêmes que dans l'appli) */
.waves { position: absolute; inset-inline: 0; inset-block-end: -1px; inline-size: 100%; block-size: clamp(56px, 8vw, 116px); pointer-events: none; }
.waves .w1 { fill: var(--wave-4); } .waves .w2 { fill: var(--wave-2); } .waves .w3 { fill: var(--wave-3); }
.waves:dir(rtl) { transform: scaleX(-1); }
.scene { background: radial-gradient(120% 100% at 50% 0%, var(--scene-b), var(--scene-a)); border-radius: var(--r-scene); }
