/* =============================================================================
 *  Ma Boussole | بوصلتي — styles.css
 *  =============================================================================
 *  DIRECTION ARTISTIQUE : Editorial Méditerranéen
 *    Papier crème, encre bleu nuit, ocre cuivré en accent.
 *    Typographie littéraire et institutionnelle : Fraunces + Plus Jakarta Sans + Amiri.
 *    Inspirations : éditions de livres de philosophie, reliure marocaine,
 *    céramique de Fès, linéaires de calligraphie arabe épurée.
 *
 *  MEMORABLE ELEMENT : un losange ornemental (rappel du zellige) utilisé
 *    comme séparateur et comme accent, et la marque bi-typographique assumée
 *    (Ma Boussole italique + بوصلتي).
 *
 *  Mobile-first, WCAG 2.1 AA, prefers-reduced-motion respecté, impression.
 * ============================================================================= */

/* ---------- 1. Tokens ----------------------------------------------------- */
:root {
  /* ===== Palette ===== */
  --ink:             #0B1F3A;
  --ink-soft:        #2C3E5C;
  --ink-muted:       #6C7A94;
  --ink-hush:        #9BA7BC;

  --paper:           #FAF5EC;
  --paper-soft:      #F4ECD8;
  --paper-warm:      #F7F1E1;
  --paper-deep:      #EEE3C8;

  --copper:          #B5651D;
  --copper-deep:     #8F4E14;
  --copper-soft:     #E8D4B5;
  --copper-hush:     #F4E8D3;

  --emerald:         #0F5D4A;
  --emerald-deep:    #0A4536;
  --emerald-soft:    #D4E4DD;
  --emerald-hush:    #E7F0EC;

  --amber-bg:        #F4E8D3;
  --amber-ink:       #8F4E14;

  --line:            #E0D7C0;
  --line-strong:     #C7B996;
  --line-hairline:   #EDE5D1;

  --danger:          #A33D2A;
  --danger-soft:     #F6E5DE;

  /* ===== Typographie ===== */
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans:    'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-arabic:  'Amiri', 'Geeza Pro', 'Arabic Typesetting', 'Noto Naskh Arabic', serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-xs:   0.8125rem;
  --fs-sm:   0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md:   1.1875rem;
  --fs-lg:   1.4375rem;
  --fs-xl:   1.8125rem;
  --fs-2xl:  2.375rem;
  --fs-3xl:  3.125rem;
  --fs-4xl:  4rem;
  --fs-display: 4.75rem;

  --lh-tight: 1.15;
  --lh-snug:  1.3;
  --lh-base:  1.62;

  --letter-tight:  -0.02em;
  --letter-normal:  0;
  --letter-wide:    0.04em;
  --letter-wider:   0.12em;

  /* ===== Espacements ===== */
  --s-0: 0;
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-7: 2rem;
  --s-8: 2.5rem;
  --s-9: 3rem;
  --s-10: 4rem;
  --s-11: 5rem;
  --s-12: 6rem;
  --s-14: 8rem;

  /* ===== Rayons ===== */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* ===== Ombres ===== */
  --shadow-xs:   0 1px 2px rgba(11, 31, 58, 0.04);
  --shadow-sm:   0 2px 8px rgba(11, 31, 58, 0.05), 0 1px 2px rgba(11, 31, 58, 0.04);
  --shadow-md:   0 10px 24px -8px rgba(11, 31, 58, 0.12), 0 4px 8px -4px rgba(11, 31, 58, 0.06);
  --shadow-lg:   0 24px 48px -16px rgba(11, 31, 58, 0.18), 0 8px 16px -8px rgba(11, 31, 58, 0.08);
  --shadow-focus: 0 0 0 3px rgba(15, 93, 74, 0.22);

  /* ===== Transitions ===== */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 360ms;

  --w-narrow:    44rem;
  --w-readable:  56rem;
  --w-wide:      72rem;
}

/* ---------- 2. Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

/* ---------- 3. Base ------------------------------------------------------ */
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink-soft);
  background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(181, 101, 29, 0.035) 1px, transparent 0);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
}
::selection { background: var(--copper-soft); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--letter-tight);
  font-feature-settings: "ss01", "calt", "liga";
}
h1 { font-size: clamp(2.125rem, 4.2vw + 1rem, var(--fs-3xl)); }
h2 { font-size: clamp(1.625rem, 2.2vw + 0.8rem, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p  { font-size: var(--fs-base); color: var(--ink-soft); }
p  + p { margin-top: var(--s-4); }

a {
  color: var(--emerald);
  text-decoration-line: underline;
  text-decoration-color: rgba(15, 93, 74, 0.25);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-base) var(--ease), text-decoration-color var(--t-base) var(--ease);
}
a:hover { color: var(--emerald-deep); text-decoration-color: var(--emerald-deep); }

strong, b { font-weight: 700; color: var(--ink); }
em, i { font-style: italic; }

.ar, [lang="ar"] { font-family: var(--font-arabic); font-weight: 400; letter-spacing: 0; }

small { font-size: var(--fs-sm); color: var(--ink-muted); }
code { font-family: var(--font-mono); font-size: 0.875em; color: var(--copper-deep); background: var(--copper-hush); padding: 0.1em 0.35em; border-radius: var(--r-xs); }

hr { border: 0; height: 1px; background: var(--line); margin-block: var(--s-8); }

/* ---------- 4. Accessibilité --------------------------------------------- */
.skip-link {
  position: absolute;
  top: 0; left: -10000px;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-5);
  border-radius: 0 0 var(--r-md) 0;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.hidden { display: none !important; }

.field__error {
  display: block;
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: var(--s-2);
  font-weight: 500;
}
.field--error .input,
.field--error .select,
.field--error .textarea {
  border-color: var(--danger);
}

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---------- 5. Layout ---------------------------------------------------- */
.container          { width: 100%; max-width: var(--w-wide);     margin-inline: auto; padding-inline: var(--s-5); }
.container-readable { width: 100%; max-width: var(--w-readable); margin-inline: auto; padding-inline: var(--s-5); }
.container-narrow   { width: 100%; max-width: var(--w-narrow);   margin-inline: auto; padding-inline: var(--s-5); }

@media (min-width: 768px) {
  .container, .container-readable, .container-narrow { padding-inline: var(--s-8); }
}

.section    { padding-block: var(--s-11); }
.section-lg { padding-block: var(--s-12); }

.grid    { display: grid; gap: var(--s-6); }
.grid-2  { grid-template-columns: 1fr; }
.grid-3  { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.grid-3 { gap: var(--s-7); }

.text-center { text-align: center; }
.text-muted  { color: var(--ink-muted); }

/* ---------- 6. Ornements ------------------------------------------------- */
.ornament {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--copper);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 0 L10 6 L16 8 L10 10 L8 16 L6 10 L0 8 L6 6 Z' fill='black'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 0 L10 6 L16 8 L10 10 L8 16 L6 10 L0 8 L6 6 Z' fill='black'/></svg>") center / contain no-repeat;
  vertical-align: middle;
  flex-shrink: 0;
}
.ornament--lg { width: 1.5rem; height: 1.5rem; }
.ornament--emerald { background: var(--emerald); }

.ornament-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  margin-block: var(--s-9);
}
.ornament-rule::before,
.ornament-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 50%, transparent);
  max-width: 8rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-wider);
  color: var(--copper);
  margin-bottom: var(--s-3);
}

/* ---------- 7. Header institutionnel ------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 245, 236, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-hairline);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-4);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-lg);
  letter-spacing: var(--letter-tight);
  font-style: italic;
}
.brand-ar {
  font-family: var(--font-arabic);
  font-weight: 400;
  color: var(--emerald);
  font-size: var(--fs-md);
}
.header-lang {
  display: inline-flex;
  gap: 2px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
}
.lang-btn {
  appearance: none;
  padding: var(--s-1) var(--s-4);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-muted);
  border-radius: var(--r-pill);
  letter-spacing: var(--letter-wide);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  min-height: 32px;
}
.lang-btn:hover:not([disabled]) { color: var(--ink); background: rgba(255,255,255,0.4); }
.lang-btn.is-active { background: var(--ink); color: var(--paper); }
.lang-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- 8. Hero ------------------------------------------------------ */
.hero {
  padding-block: var(--s-12) var(--s-11);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 720px; height: 720px;
  transform: translate(-50%, -40%) rotate(45deg);
  background: radial-gradient(ellipse at center, var(--copper-hush) 0%, transparent 65%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
.hero .container-readable { position: relative; z-index: 1; text-align: center; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-wider);
  color: var(--copper);
  padding: var(--s-2) var(--s-4);
  background: var(--copper-hush);
  border: 1px solid var(--copper-soft);
  border-radius: var(--r-pill);
  margin-bottom: var(--s-7);
}

.hero__title,
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw + 1rem, var(--fs-display));
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
}
.hero__title em,
.hero h1 em {
  font-style: italic;
  color: var(--copper);
  font-weight: 400;
}
.hero__title-ar {
  font-family: var(--font-arabic);
  font-size: clamp(1.75rem, 3.5vw + 1rem, 2.75rem);
  font-weight: 400;
  color: var(--emerald);
  margin-top: var(--s-2);
  line-height: 1;
}
.hero__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 1.8vw + 0.75rem, 1.625rem);
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: var(--s-5);
  letter-spacing: -0.01em;
}
.hero__desc {
  font-size: var(--fs-md);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 38rem;
  margin: var(--s-5) auto 0;
}
.hero__cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-8);
}
@media (min-width: 560px) {
  .hero__cta-row { flex-direction: row; justify-content: center; }
}
.hero__trust {
  margin-top: var(--s-7);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  justify-content: center;
  color: var(--ink-muted);
  font-size: var(--fs-sm);
}
.hero__trust-sep {
  display: inline-block;
  width: 4px; height: 4px;
  background: var(--line-strong);
  border-radius: 50%;
}

/* ---------- 9. Boutons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-7);
  min-height: 48px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease),
              box-shadow var(--t-base) var(--ease);
  line-height: 1;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:active { transform: translateY(0.5px); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--emerald-deep);
  border-color: var(--emerald-deep);
  box-shadow: var(--shadow-md);
  color: var(--paper);
}
.btn--primary[disabled] {
  background: var(--line-strong);
  border-color: var(--line-strong);
  color: var(--paper);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

.btn--accent {
  background: var(--copper);
  color: var(--paper);
  border-color: var(--copper);
}
.btn--accent:hover {
  background: var(--copper-deep);
  border-color: var(--copper-deep);
  color: var(--paper);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  background: var(--paper-soft);
  border-color: var(--ink);
  color: var(--ink);
}

.btn--link {
  background: transparent;
  color: var(--emerald);
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: auto;
  padding: var(--s-2) 0;
  border: 0;
}
.btn--link:hover { color: var(--emerald-deep); }

.btn--delete {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.3);
  min-height: 40px;
  padding: var(--s-3) var(--s-5);
  font-size: var(--fs-xs);
}
.btn--delete:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--small { min-height: 38px; padding: var(--s-3) var(--s-5); font-size: var(--fs-xs); }
.btn--large { min-height: 56px; padding: var(--s-5) var(--s-8); font-size: var(--fs-base); min-width: 260px; }
.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  margin-top: var(--s-8);
}

/* ---------- 10. Cartes --------------------------------------------------- */
.card {
  background: var(--paper-warm);
  border: 1px solid var(--line-hairline);
  border-radius: var(--r-lg);
  padding: var(--s-7);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
  position: relative;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: var(--fs-lg);
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 1;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-lg);
  color: var(--ink);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.015em;
}
.card__text {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}
.card--soft { background: var(--paper-soft); }

.feature {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  padding: var(--s-6);
  background: var(--paper);
  border: 1px solid var(--line-hairline);
  border-radius: var(--r-lg);
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.feature:hover { border-color: var(--copper-soft); transform: translateY(-2px); }
.feature__icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  color: var(--emerald);
  background: var(--emerald-hush);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
}
.feature__icon svg { width: 100%; height: 100%; }
.feature h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-md);
  margin: 0 0 var(--s-2) 0;
  line-height: 1.25;
  color: var(--ink);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: var(--letter-wide);
}
.chip--accent { background: var(--copper-hush); border-color: var(--copper-soft); color: var(--copper-deep); }
.chip--soft   { background: var(--emerald-hush); border-color: var(--emerald-soft); color: var(--emerald-deep); }

/* ---------- 11. Formulaires --------------------------------------------- */
.field { margin-bottom: var(--s-7); }
.field:last-child { margin-bottom: 0; }

label,
.legend {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink);
  margin-bottom: var(--s-3);
  letter-spacing: var(--letter-wide);
}

.field__hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: var(--s-2);
  line-height: 1.55;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--ink);
  line-height: 1.4;
  min-height: 52px;
  transition: border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease),
              background var(--t-base) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-hush); }

.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: var(--shadow-focus);
  background: #fff;
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
  padding: var(--s-4) var(--s-5);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%232C3E5C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='3.5 5.5 7 9 10.5 5.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--s-5) center;
  padding-right: var(--s-9);
  cursor: pointer;
}

/* ===== Radio-pill ===== */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.radio-pill {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.radio-pill input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.radio-pill span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  transition: all var(--t-base) var(--ease);
  min-height: 44px;
  white-space: nowrap;
}
.radio-pill span::before {
  content: '';
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--t-base) var(--ease);
}
.radio-pill:hover span {
  border-color: var(--line-strong);
  background: var(--paper-warm);
  color: var(--ink);
}
.radio-pill input:focus-visible + span {
  box-shadow: var(--shadow-focus);
  border-color: var(--emerald);
}
.radio-pill input:checked + span {
  background: var(--emerald-hush);
  border-color: var(--emerald);
  color: var(--emerald-deep);
  font-weight: 600;
}
.radio-pill input:checked + span::before {
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: inset 0 0 0 3px var(--emerald-hush);
}

/* ===== Consent blocks ===== */
.consent-block {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease);
}
.consent-block:hover { border-color: var(--line-strong); }
.consent-block input[type="checkbox"] {
  margin-top: 3px;
  width: 20px; height: 20px;
  accent-color: var(--emerald);
  flex-shrink: 0;
  cursor: pointer;
}
.consent-block .consent-body { flex: 1; }
.consent-block strong {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--s-1);
}
.consent-block p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.5;
}
.consent--required {
  background: var(--emerald-hush);
  border-color: var(--emerald-soft);
  border-left: 3px solid var(--emerald);
}
.consent--required strong { color: var(--emerald-deep); }

/* ---------- 12. Barre de progression ------------------------------------ */
.progress,
.mini-progress {
  position: sticky;
  top: 68px;
  z-index: 50;
  background: rgba(250, 245, 236, 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line-hairline);
  padding-block: var(--s-3);
}
.progress__inner,
.mini-progress__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  max-width: var(--w-wide);
  margin-inline: auto;
  padding-inline: var(--s-5);
}
.progress__bar,
.mini-progress__bar {
  flex: 1;
  height: 4px;
  background: var(--line-hairline);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress__fill,
.mini-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--copper));
  border-radius: var(--r-pill);
  transition: width var(--t-slow) var(--ease-out);
}
.progress__label,
.mini-progress__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: var(--letter-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- 13. Questionnaire ------------------------------------------- */
.q-card {
  max-width: var(--w-readable);
  margin: var(--s-8) auto 0;
  background: var(--paper-warm);
  border: 1px solid var(--line-hairline);
  border-radius: var(--r-xl);
  padding: var(--s-9) var(--s-7);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) {
  .q-card { padding: var(--s-10) var(--s-11); }
}

.q-card__theme {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: var(--letter-wider);
  margin-bottom: var(--s-5);
}
.q-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 var(--s-2);
  background: var(--copper);
  color: var(--paper);
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0;
  line-height: 1;
}
.q-card__section { color: var(--ink); }
.q-card__sep { color: var(--line-strong); font-weight: 400; }
.q-card__text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw + 0.75rem, 2rem);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 var(--s-8) 0;
  letter-spacing: -0.015em;
  font-weight: 500;
}

.options {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-8);
}
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-6);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--ink-soft);
  line-height: 1.45;
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
}
.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.option__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  background: var(--paper-soft);
  color: var(--ink-muted);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: var(--fs-md);
  line-height: 1;
  transition: all var(--t-base) var(--ease);
}
.option__text {
  flex: 1;
  min-width: 0;
}
.option:hover {
  border-color: var(--line-strong);
  background: var(--paper-warm);
  color: var(--ink);
  transform: translateY(-1px);
}
.option:hover .option__letter {
  background: var(--paper);
  border-color: var(--ink-muted);
  color: var(--ink);
}
.option:has(input:checked),
.option.is-checked {
  border-color: var(--emerald);
  background: var(--emerald-hush);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 93, 74, 0.08);
}
.option:has(input:checked) .option__letter,
.option.is-checked .option__letter {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--paper);
}
.option:focus-within {
  box-shadow: var(--shadow-focus);
  border-color: var(--emerald);
  outline: none;
}

.q-card--avoid .q-card__theme { color: var(--amber-ink); }
.q-card--avoid .q-card__num { background: var(--amber-ink); }
.q-card--avoid .option:has(input:checked),
.q-card--avoid .option.is-checked {
  border-color: var(--amber-ink);
  background: var(--amber-bg);
}
.q-card--avoid .option:has(input:checked) .option__letter,
.q-card--avoid .option.is-checked .option__letter {
  background: var(--amber-ink);
  border-color: var(--amber-ink);
  color: var(--paper);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-6);
}
.char-counter {
  text-align: right;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: var(--s-2);
}

/* ---------- 14. Résultats ------------------------------------------------ */
.results-hero {
  text-align: center;
  padding-block: var(--s-8) var(--s-9);
}
.results-hero h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
}
.value-card {
  display: flex;
  gap: var(--s-5);
  padding: var(--s-7);
  background: var(--paper-warm);
  border: 1px solid var(--line-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--s-5);
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.value-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.value-card__rank {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: var(--fs-xl);
  flex-shrink: 0;
  line-height: 1;
}
.value-card__body { flex: 1; }
.value-card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-xl);
  color: var(--ink);
  margin: 0 0 var(--s-2) 0;
  letter-spacing: -0.015em;
}
.value-card__ar {
  font-family: var(--font-arabic);
  font-weight: 400;
  color: var(--emerald);
  font-size: var(--fs-md);
  margin-left: var(--s-3);
}
.value-card__desc {
  font-size: var(--fs-base);
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

.avoid-card {
  padding: var(--s-8);
  background: var(--amber-bg);
  border: 1px solid var(--copper-soft);
  border-left: 3px solid var(--amber-ink);
  border-radius: var(--r-lg);
  margin-top: var(--s-8);
}
.avoid-card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--amber-ink);
  margin-bottom: var(--s-4);
}
.avoid-card__ar {
  font-family: var(--font-arabic);
  font-weight: 400;
  color: var(--amber-ink);
  margin-left: var(--s-3);
}

.reflection-quote {
  padding: var(--s-6) var(--s-7);
  background: var(--paper);
  border-left: 3px solid var(--emerald);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-md);
  color: var(--ink);
  line-height: 1.55;
  margin-block: var(--s-4);
}
.reflection-quote strong {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--letter-wider);
  color: var(--emerald);
  margin-bottom: var(--s-2);
}

/* ---------- 15. Pages légales ------------------------------------------- */
.legal {
  padding-block: var(--s-9) var(--s-12);
  background: var(--paper);
}
.legal h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.25rem, 4vw + 1rem, 3rem);
  color: var(--ink);
  line-height: 1.1;
  margin: 0 0 var(--s-2) 0;
  letter-spacing: -0.025em;
}
.legal h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-xl);
  color: var(--ink);
  margin-top: var(--s-9);
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.015em;
}
.legal h2:first-of-type { margin-top: var(--s-8); }
.legal p,
.legal li {
  color: var(--ink-soft);
  line-height: 1.7;
  font-size: var(--fs-base);
}
.legal ul, .legal ol { padding-left: var(--s-6); margin-block: var(--s-4); }
.legal li + li { margin-top: var(--s-2); }
.legal strong { color: var(--ink); }
.legal-lead {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-muted);
  font-size: var(--fs-md);
  margin: var(--s-3) 0 var(--s-7) 0;
}
.legal-callout {
  background: var(--paper-soft);
  border-left: 3px solid var(--copper);
  padding: var(--s-5) var(--s-6);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-block: var(--s-6);
}
.legal-callout p { margin: 0 0 var(--s-2) 0; }
.legal-callout p:last-child { margin-bottom: 0; }
.legal-callout strong { color: var(--ink); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--emerald);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--letter-wide);
  margin-bottom: var(--s-5);
  padding: var(--s-2) 0;
}
.back-link:hover { color: var(--emerald-deep); text-decoration: underline; }

/* ---------- 16. Alertes, spinner --------------------------------------- */
.alert {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  margin-bottom: var(--s-5);
  font-size: var(--fs-sm);
  line-height: 1.55;
  border: 1px solid transparent;
}
.alert--error {
  background: var(--danger-soft);
  border-color: rgba(163, 61, 42, 0.25);
  color: var(--danger);
}
.alert--info {
  background: var(--emerald-hush);
  border-color: var(--emerald-soft);
  color: var(--emerald-deep);
}
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 17. Footer institutionnel ---------------------------------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  margin-top: var(--s-12);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--copper) 30%, var(--copper) 70%, transparent 100%);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
  padding-block: var(--s-10) var(--s-8);
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

.footer-brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: var(--fs-xl);
  color: #fff;
  margin-bottom: var(--s-3);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.footer-brand [lang="ar"] {
  font-family: var(--font-arabic);
  font-style: normal;
  font-weight: 400;
  color: var(--copper-soft);
  margin-left: var(--s-2);
  font-size: 0.85em;
}
.footer-tagline {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  font-size: var(--fs-sm);
  margin: 0 0 var(--s-2) 0;
}
.footer-mini {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--fs-xs);
  line-height: 1.5;
  margin: 0 0 var(--s-4) 0;
}
.footer-title {
  color: var(--copper-soft);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--letter-wider);
  margin: 0 0 var(--s-4) 0;
}
.footer-address {
  font-style: normal;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-sm);
  line-height: 1.7;
  margin: 0 0 var(--s-3) 0;
}
.footer-address strong { color: #fff; }
.footer-contact {
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-sm);
  line-height: 1.9;
  margin: 0;
}
.footer-contact a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: border-color var(--t-base) var(--ease);
}
.footer-contact a:hover { border-color: var(--copper-soft); }

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-3);
}
.footer-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color var(--t-base) var(--ease), padding-left var(--t-base) var(--ease);
  display: inline-block;
}
.footer-links a:hover { color: var(--copper-soft); padding-left: 4px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: var(--s-5);
}
.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--fs-xs);
  text-align: center;
  letter-spacing: var(--letter-wide);
}
.footer-attribution {
  font-family: var(--font-display);
  font-style: italic;
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: var(--fs-sm) !important;
  letter-spacing: normal !important;
  margin-bottom: var(--s-3) !important;
  line-height: 1.5;
}
.footer-attribution strong {
  color: var(--copper-soft);
  font-weight: 500;
  font-style: normal;
  font-family: var(--font-sans);
}

/* ---------- 18. Préparation RTL ---------------------------------------- */
[dir="rtl"] .option { padding-left: var(--s-6); padding-right: 3.25rem; }
[dir="rtl"] .option::before { left: auto; right: var(--s-5); }
[dir="rtl"] .avoid-card { border-left: none; border-right: 3px solid var(--amber-ink); }
[dir="rtl"] .reflection-quote { border-left: none; border-right: 3px solid var(--emerald); border-radius: var(--r-md) 0 0 var(--r-md); }
[dir="rtl"] .value-card__ar { margin-left: 0; margin-right: var(--s-3); }
[dir="rtl"] .consent--required { border-left: none; border-right: 3px solid var(--emerald); }
[dir="rtl"] .brand-ar { margin-left: 0; margin-right: var(--s-2); }
[dir="rtl"] .footer-brand [lang="ar"] { margin-left: 0; margin-right: var(--s-2); }
[dir="rtl"] .legal-callout { border-left: none; border-right: 3px solid var(--copper); border-radius: var(--r-md) 0 0 var(--r-md); }

/* ---------- 19. Réduction d'animations --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero::before { display: none; }
}

/* ---------- 20. Impression --------------------------------------------- */
@media print {
  .site-header, .site-footer, .header-lang, .progress, .mini-progress, .nav-row, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .hero::before { display: none; }
  .legal { padding: 0; }
}

/* ---------- 21. Animations d'entrée ------------------------------------ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
main > * { animation: fade-up 0.45s var(--ease-out) both; }
