/* Institut Arabe WAQF EUROPE — feuille de style
   Mise en page : bandeau nuit (hero) puis sections claires alternées,
   motif de l'étoile à huit branches comme signature. */

:root {
  --navy: #13233f;
  --navy-deep: #0c1830;
  --teal: #0e6e6b;
  --teal-soft: #e3f0ee;
  --gold: #b8892b;
  --gold-bright: #d4a647;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --tint: #edf2f1;
  --ink: #14202e;
  --muted: #566572;
  --line: #d6dfde;
  --on-dark: #eef3f4;
  --on-dark-muted: #b4c2cc;

  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif;
  --font-ar-display: "Reem Kufi", "Noto Naskh Arabic", serif;

  --radius: 10px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0f1d36; --navy-deep: #0a1426; --teal: #45b3ab; --teal-soft: #15322f;
    --gold: #d9ae55; --gold-bright: #e6c070;
    --bg: #0d1524; --surface: #142038; --tint: #111c30;
    --ink: #e7edf0; --muted: #9eaebb; --line: #26375a;
    --on-dark: #eef3f4; --on-dark-muted: #a9b8c4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #0f1d36; --navy-deep: #0a1426; --teal: #45b3ab; --teal-soft: #15322f;
  --gold: #d9ae55; --gold-bright: #e6c070;
  --bg: #0d1524; --surface: #142038; --tint: #111c30;
  --ink: #e7edf0; --muted: #9eaebb; --line: #26375a;
  --on-dark: #eef3f4; --on-dark-muted: #a9b8c4;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; border-radius: 4px; }

/* Arabe : polices et sens de lecture */
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.8; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-family: var(--font-ar-display); font-weight: 700; line-height: 1.45; }
html[lang="ar"] .eyebrow { letter-spacing: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Bandeau "version de travail" */
.draft-banner {
  background: var(--gold);
  color: var(--navy-deep);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  padding: 6px 16px;
}

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy);
  color: var(--on-dark);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; fill: none; stroke: var(--gold-bright); stroke-width: 2; }
.brand-mark circle { fill: var(--gold-bright); stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-size: 1.1rem; }
html[lang="ar"] .brand-name { font-family: var(--font-ar-display); }
.brand-sub { font-size: .7rem; letter-spacing: .18em; color: var(--gold-bright); font-weight: 600; }
.main-nav { display: flex; gap: 18px; margin-inline-start: auto; align-items: center; }
.main-nav a { text-decoration: none; font-size: .95rem; color: var(--on-dark-muted); }
.main-nav a:hover { color: var(--on-dark); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  background: transparent; color: var(--on-dark-muted); border: 0; cursor: pointer;
  font: 600 .8rem var(--font-body); padding: 6px 9px;
}
.lang-switch .ar-label { font-family: var(--font-ar); font-size: .85rem; padding-block: 3px; }
.lang-switch button[aria-pressed="true"] { background: var(--gold-bright); color: var(--navy-deep); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 8px; border: 1.5px solid transparent;
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
html[lang="ar"] .btn { font-family: var(--font-ar); }
.btn:hover { transform: translateY(-1px); }
.btn-small { padding: 8px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold-bright); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-outline { border-color: var(--teal); color: var(--teal); background: transparent; }
.btn-ghost { border-color: rgba(255,255,255,.35); color: var(--on-dark); background: transparent; }

/* Hero */
.hero { position: relative; background: var(--navy); color: var(--on-dark); overflow: hidden; }
.hero-pattern {
  position: absolute; inset: 0; opacity: .09; background: var(--gold-bright);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='black' stroke-width='1.2'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E") 0 0/64px 64px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='black' stroke-width='1.2'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E") 0 0/64px 64px;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.25fr .75fr; gap: 48px; align-items: center;
  padding-block: 72px 56px;
}
.hero-text { min-width: 0; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-bright); margin-bottom: 14px; }
.eyebrow-teal { color: var(--teal); }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 20px; }
.hero-lead { font-size: 1.15rem; color: var(--on-dark-muted); max-width: 34em; margin-bottom: 30px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-emblem { position: relative; margin: 0; display: grid; place-items: center; max-width: 340px; justify-self: center; width: 100%; }
.hero-emblem svg { width: 100%; height: auto; }
.star-line { fill: none; stroke: var(--gold-bright); stroke-width: 1.5; }
.star-ring { fill: none; stroke: var(--on-dark-muted); stroke-width: 1; stroke-dasharray: 3 6; opacity: .6; }
.emblem-word {
  position: absolute; font-family: var(--font-ar); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.2rem); color: var(--on-dark); line-height: 1;
}

/* Bande alphabet */
.alphabet-band {
  position: relative; background: var(--teal); color: #fff; overflow: hidden;
  font-family: var(--font-ar); font-size: 1.6rem; padding-block: 10px; white-space: nowrap;
}
.alphabet-track { display: inline-flex; gap: 3rem; animation: drift 60s linear infinite; }
.alphabet-track span { word-spacing: .9rem; opacity: .9; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) {
  .alphabet-track { animation: none; }
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}

/* Sections */
.section { padding-block: 72px; }
.section-tint { background: var(--tint); }
.section-navy { background: var(--navy); color: var(--on-dark); }
.section-head { margin-bottom: 36px; max-width: 40em; }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }

/* Engagements */
.pillars-section { padding-block: 48px; border-bottom: 1px solid var(--line); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.pillar h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--teal); }
.pillar p { color: var(--muted); }

/* Enseignements */
.course-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.course-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.course-top h3 { font-size: 1.5rem; }
.course-ar { font-family: var(--font-ar); font-size: 1.5rem; color: var(--gold); order: 2; }
html[lang="ar"] .course-ar { display: none; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-inline-start: 26px; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: .55em;
  width: 10px; height: 10px; background: var(--teal); transform: rotate(45deg); border-radius: 2px;
}
.formats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.format { padding: 24px 28px; border-radius: var(--radius); background: var(--teal-soft); }
.format h3 { font-size: 1.2rem; margin-bottom: 6px; }
.format p { color: var(--muted); }

/* Publics */
.audience-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.audience { background: var(--surface); border-radius: var(--radius); padding: 22px; border-top: 3px solid var(--gold); }
.age { display: block; font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 8px; }
html[lang="ar"] .age { font-family: var(--font-ar-display); }
.audience p { color: var(--muted); font-size: .95rem; }
.levels { margin-top: 36px; display: grid; gap: 12px; }
.levels-label { font-weight: 700; }
.level-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; counter-reset: lv; }
.level-steps li {
  counter-increment: lv; background: var(--surface); padding: 12px 16px; font-weight: 600;
  border: 1px solid var(--line);
}
.level-steps li::before { content: counter(lv); color: var(--gold); font-family: var(--font-display); margin-inline-end: 10px; }
.level-steps li:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.level-steps li:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; background: var(--teal); color: #fff; border-color: var(--teal); }
.level-steps li:last-child::before { color: #fff; }
.levels-note { color: var(--muted); font-size: .95rem; }

/* Fonctionnement */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
.steps li { position: relative; }
.step-n {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px;
  border: 1.5px solid var(--gold); color: var(--gold); border-radius: 50%;
  font-family: var(--font-display); font-size: 1.2rem; background: var(--bg);
}
.steps h3 { font-size: 1.15rem; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: .95rem; }

.platform {
  margin-top: 56px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center;
  background: var(--navy); color: var(--on-dark); border-radius: 14px; padding: 36px;
}
.platform-text { min-width: 0; }
.badge { display: inline-block; background: var(--gold-bright); color: var(--navy-deep); font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
.platform h3 { font-size: 1.5rem; margin-bottom: 8px; }
.platform p { color: var(--on-dark-muted); }
.platform-cta { margin-top: 18px; }
.hp-field { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; inset-inline-start: 0; top: 0; opacity: 0; pointer-events: none; }
.platform-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.platform-list li { border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--on-dark-muted); }
.platform-list li.is-live { padding: 0; border-color: var(--gold-bright); background: var(--gold-bright); }
.platform-list li.is-live a { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; color: var(--navy-deep); text-decoration: none; font-weight: 700; }
.platform-list li.is-live:hover { background: var(--gold); }
.pl-go { font-size: 1.2rem; }
html[dir="rtl"] .pl-go { transform: scaleX(-1); }
.pl-soon { font-size: .75rem; font-weight: 600; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 1px 8px; }

/* Tarifs */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.price-card .btn { margin-top: auto; }
.price-main { border: 2px solid var(--teal); }
.price-card h3 { font-size: 1.25rem; }
.price { display: flex; align-items: baseline; gap: 6px; }
.amount { font-family: var(--font-display); font-size: 2.4rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.per { color: var(--muted); }

/* FAQ */
.faq-wrap { max-width: 860px; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 18px; color: var(--muted); }

/* Formulaire */
.form-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; }
.form-intro h2 { margin-bottom: 12px; }
.form-intro p:last-child { color: var(--on-dark-muted); }
.form, .form-success { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 28px; min-width: 0; }
.form-success { grid-column: 2; }
.form-success h3 { font-size: 1.4rem; margin-bottom: 8px; }
.form-success p { color: var(--muted); margin-bottom: 18px; }
.form-success .btn-ghost { border-color: var(--teal); color: var(--teal); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; display: grid; gap: 14px; min-width: 0; }
legend { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 10px; padding: 0; }
html[lang="ar"] legend { font-family: var(--font-ar-display); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row .field-narrow { max-width: 140px; }
.row:has(.field-narrow) { grid-template-columns: 1fr auto; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .9rem; font-weight: 600; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.field.invalid input, .field.invalid select { border-color: #c0392b; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.consent input { width: auto; margin-top: 4px; }
.consent.invalid { color: #c0392b; }
.form-error { color: #c0392b; font-weight: 600; margin-top: 12px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-grid h2 { margin-bottom: 10px; }
.contact-grid p { color: var(--muted); }
.contact-list { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.contact-list div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-list dt { font-weight: 700; }
.contact-list dd { margin: 0; }
.todo { color: var(--gold); font-style: italic; }

/* Pied de page */
.site-footer { background: var(--navy-deep); color: var(--on-dark-muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 24px; }
.footer-links { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--on-dark); }

/* Bouton WhatsApp flottant */
.whatsapp-fab {
  position: fixed; inset-inline-end: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px; border-radius: 50%; background: #25d366; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 30;
}
.whatsapp-fab svg { width: 28px; height: 28px; fill: #fff; }

/* Accueil : deux portes d'entrée */
.nav-plat { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--gold-bright) !important; }
.nav-badge { font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--gold-bright); color: var(--navy); border-radius: 999px; padding: 2px 7px; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 36px; position: relative; z-index: 1; }
.door { border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; transition: transform .15s ease; }
.door:hover { transform: translateY(-3px); }
.door-title { margin: 0; font-size: 1.4rem; }
.door p { margin: 0; font-size: .97rem; }
.door ul { margin: 0; padding-inline-start: 18px; font-size: .92rem; }
.door-go { font-weight: 800; margin-top: auto; padding-top: 6px; }
.door-prof { background: #fff; color: var(--navy); }
.door-prof .door-title { color: var(--navy); }
.door-prof p, .door-prof ul { color: #3d4c5c; }
.door-prof .door-go { color: var(--gold-deep, #b8892b); }
.door-auto { background: linear-gradient(160deg, #1d3358, #13233f); color: #fff; border: 2px solid #d4a647;
  box-shadow: 0 0 0 4px rgba(212,166,71,.15), 0 10px 30px rgba(0,0,0,.35); }
.door-auto .door-title { color: #ffd77a; }
.door-auto p, .door-auto ul { color: #d5dde8; }
.door-icons { display: flex; gap: 6px; }
.door-icons img { width: 40px; height: 40px; background: #fff; border-radius: 10px; padding: 4px; }
.door-btn { align-self: flex-start; background: #d4a647; color: var(--navy); border-radius: 10px; padding: 9px 16px; }
.door-auto:hover .door-btn { background: #e2b85a; }
@media (prefers-reduced-motion: reduce) { .door { transition: none; } .door:hover { transform: none; } }

/* Responsive */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .header-actions { margin-inline-start: auto; }
  .hero-inner { grid-template-columns: 1fr; padding-block: 48px 40px; }
  .hero-emblem { max-width: 220px; order: -1; }
  .audience-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .price-grid { grid-template-columns: 1fr; max-width: 460px; }
  .form-layout, .contact-grid, .platform { grid-template-columns: 1fr; }
  .form-success { grid-column: auto; }
  .doors { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .section { padding-block: 52px; }
  .brand-text { display: none; }
  .pillars, .course-grid, .formats, .audience-grid, .steps, .row { grid-template-columns: 1fr; }
  .row:has(.field-narrow) { grid-template-columns: 1fr; }
  .row .field-narrow { max-width: none; }
  .level-steps { grid-template-columns: 1fr 1fr; }
  .level-steps li { border-radius: 8px !important; }
  .platform { padding: 24px; }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
  .alphabet-band { font-size: 1.3rem; }
}

/* Bouton « Mon espace » (accès à la plateforme : connexion, compte) */
.btn-espace { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 1220px) { .btn-espace span { display: none; } .btn-espace { padding-inline: 10px; } }
@media (max-width: 960px) { .btn-espace span { display: inline; } }
@media (max-width: 420px) { .btn-espace span { display: none; } }

