/* ───────────────────────────────────────────────────────────────────────────
   Al Majlis Al ʿIlmi — site agencedhd.com
   Direction : éditoriale, spirituelle, sereine. Verts profonds + or + crème.
   Titres en serif (Fraunces), corps en Inter. Aucun emoji — icônes SVG fines.
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700&display=swap');

:root {
  --ink:        #0E2A22;
  --forest:     #143A2E;
  --forest-2:   #1B4332;
  --teal:       #0D3B34;
  --gold:       #C8A24C;
  --gold-soft:  #E3C988;
  --paper:      #F5F1E8;
  --paper-2:    #EFE9DC;
  --surface:    #FFFFFF;
  --text:       #1B2A24;
  --text-soft:  #5E6B63;
  --line:       rgba(20, 58, 46, 0.12);
  --r:          18px;
  --r-lg:       28px;
  --shadow:     0 18px 50px rgba(14, 42, 34, 0.10);
  --shadow-sm:  0 6px 20px rgba(14, 42, 34, 0.07);
  --maxw:       1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.serif { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Étiquette « eyebrow » dorée ─────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); opacity: 0.7; }
.eyebrow.center::after { content: ""; width: 26px; height: 1px; background: var(--gold); opacity: 0.7; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-gold { background: var(--gold); color: #1c2118; }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-dark { background: var(--forest-2); color: #fff; }
.btn-dark:hover { background: var(--forest); }
.btn-lg { padding: 17px 34px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Icônes SVG ──────────────────────────────────────────────────────────── */
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Barre de navigation ─────────────────────────────────────────────────── */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
}
.nav .container { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(200,162,76,0.55);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  flex-shrink: 0;
}
.brand-seal img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.brand-seal .icon { width: 22px; height: 22px; }
.brand-text .name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; color: #fff; line-height: 1.1; }
.brand-text .ar { font-size: 12px; color: rgba(255,255,255,0.6); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-cta { color: #fff; font-weight: 500; font-size: 14px; border: 1px solid rgba(255,255,255,0.3); padding: 10px 20px; border-radius: 999px; transition: all .2s ease; white-space: nowrap; }
.nav-cta:hover { border-color: var(--gold); color: var(--gold); }
/* Sélecteur de langue */
.lang-switch { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; }
.lang-switch button { border: none; background: transparent; color: rgba(255,255,255,0.7); font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; padding: 6px 11px; border-radius: 999px; cursor: pointer; line-height: 1; transition: all .15s ease; }
.lang-switch button:hover { color: #fff; }
.lang-switch button.active { background: var(--gold); color: #1c2118; }
@media (max-width: 560px) { .nav-cta { display: none; } }

/* ── Langues d'enseignement (puces) ──────────────────────────────────────── */
.lang-pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.lang-pills span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.lang-pills span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* ── Arabe / droite-à-gauche ─────────────────────────────────────────────── */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] body, [dir="rtl"] .serif, [dir="rtl"] .brand-text .name, [dir="rtl"] .footer .name { font-family: 'Noto Kufi Arabic', 'Inter', sans-serif; }
[dir="rtl"] .hero h1, [dir="rtl"] .section-head h2, [dir="rtl"] .cta h2, [dir="rtl"] .page-hero h1, [dir="rtl"] .band blockquote { letter-spacing: 0; line-height: 1.4; }
[dir="rtl"] .list-check li { flex-direction: row-reverse; }
[dir="rtl"] .btn .icon { transform: scaleX(-1); }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
[dir="rtl"] .band .container, [dir="rtl"] .page-hero .container, [dir="rtl"] .cta, [dir="rtl"] .section-head.center { text-align: center; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { position: relative; min-height: 660px; display: flex; align-items: center; color: #fff; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.02); }
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,28,22,0.92) 0%, rgba(8,28,22,0.72) 42%, rgba(8,28,22,0.30) 100%),
    linear-gradient(0deg, rgba(8,28,22,0.55), rgba(8,28,22,0.10));
}
.hero .container { position: relative; z-index: 2; padding-top: 120px; padding-bottom: 90px; }
.hero h1 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(38px, 6vw, 68px); line-height: 1.05; letter-spacing: -0.01em; max-width: 16ch; }
.hero h1 em { font-style: italic; color: var(--gold-soft); }
.hero p { margin-top: 22px; font-size: 18px; color: rgba(255,255,255,0.82); max-width: 52ch; }
.hero-actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-ar { font-family: 'Fraunces', serif; font-size: 22px; color: var(--gold-soft); margin-bottom: 18px; opacity: 0.95; }

/* ── Sections ────────────────────────────────────────────────────────────── */
section { position: relative; }
.section { padding: 92px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(28px, 4vw, 44px); line-height: 1.12; margin-top: 16px; letter-spacing: -0.01em; }
.section-head p { margin-top: 14px; font-size: 17px; color: var(--text-soft); }

/* ── Grille de piliers / cartes ──────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.pillar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 28px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pillar-ico {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 18px;
  background: rgba(200,162,76,0.12); color: var(--forest-2);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(200,162,76,0.3);
}
.pillar-ico .icon { width: 24px; height: 24px; }
.pillar h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px; margin-bottom: 8px; }
.pillar p { font-size: 15px; color: var(--text-soft); }

/* ── Apparition au défilement (actif seulement si JS est là) ─────────────── */
html.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .75s cubic-bezier(.2,.7,.2,1), transform .75s cubic-bezier(.2,.7,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* ── Captures de l'app (cadres de téléphone) ─────────────────────────────── */
.shots { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); overflow: hidden; }

/* Rail horizontal : défilement continu de gauche à droite, dégradés sur les bords */
.shots-rail {
  position: relative;
  margin-top: 8px;
  /* le rail déborde de la colonne pour aller bord à bord */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.phones {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 20px 14px 8px;
  will-change: transform;
  animation: shotsMarquee 48s linear infinite;
}
/* survol : on met en pause et on respire */
.shots-rail:hover .phones { animation-play-state: paused; }

.phone {
  width: 232px; flex-shrink: 0;
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.phone:hover { transform: translateY(-10px) scale(1.03); }
.phone-frame {
  position: relative; border-radius: 38px; background: #0E2A22; padding: 9px;
  box-shadow: 0 26px 60px rgba(14,42,34,0.22); border: 1px solid rgba(255,255,255,0.06);
  transition: box-shadow .45s ease;
}
.phone:hover .phone-frame { box-shadow: 0 34px 80px rgba(14,42,34,0.34); }
.phone-frame::before {
  content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 6px; border-radius: 99px; background: rgba(255,255,255,0.18); z-index: 2;
}
.phone-frame img { width: 100%; display: block; border-radius: 30px; }
.phone-cap { text-align: center; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--text-soft); }

/* déplacement vers la droite (de gauche à droite). La piste est dupliquée
   en JS : on translate d'une demi-largeur pour une boucle sans couture. */
@keyframes shotsMarquee {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .phones { animation: none; }
  .shots-rail { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
}
@media (max-width: 520px) { .phone { width: 188px; } .phones { gap: 18px; } }

/* ── Téléphone à fil défilant (capture longue des publications) ──────────── */
.scroll-phone { display: flex; justify-content: center; }
.scroll-frame {
  position: relative; width: 248px; height: 520px; flex-shrink: 0;
  border-radius: 40px; background: #0E2A22; padding: 9px; overflow: hidden;
  box-shadow: 0 26px 60px rgba(14,42,34,0.22); border: 1px solid rgba(255,255,255,0.06);
}
.scroll-frame::before {
  content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 6px; border-radius: 99px; background: rgba(255,255,255,0.18); z-index: 3;
}
.scroll-frame::after {
  /* léger dégradé haut/bas pour un rendu « écran » */
  content: ""; position: absolute; inset: 9px; border-radius: 31px; z-index: 2; pointer-events: none;
  box-shadow: inset 0 22px 26px -18px rgba(14,42,34,0.5), inset 0 -22px 26px -18px rgba(14,42,34,0.5);
}
.scroll-track { height: 100%; border-radius: 31px; overflow: hidden; }
.scroll-track img { width: 100%; display: block; animation: feedScroll 34s ease-in-out infinite; }
.scroll-frame:hover .scroll-track img { animation-play-state: paused; }
@keyframes feedScroll {
  0%, 4%   { transform: translateY(0); }
  48%, 56% { transform: translateY(calc(-100% + 502px)); }
  100%     { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .scroll-track img { animation: none; } }
@media (max-width: 520px) { .scroll-frame { width: 220px; height: 460px; } @keyframes feedScroll { 0%,4%{transform:translateY(0);} 48%,56%{transform:translateY(calc(-100% + 442px));} 100%{transform:translateY(0);} } }

/* ── Bande citation / spirituelle ────────────────────────────────────────── */
.band {
  position: relative; color: #fff; overflow: hidden;
  background: var(--teal);
}
.band-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.22; }
.band-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,28,22,0.78), rgba(8,28,22,0.88)); }
.band .container { position: relative; z-index: 2; padding: 96px 24px; text-align: center; }
.band blockquote { font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.35; max-width: 22ch; margin: 18px auto 0; }
.band cite { display: block; margin-top: 22px; font-style: normal; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-soft); }

/* ── Split image + texte ─────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.split-media { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.list-check { margin-top: 22px; display: grid; gap: 14px; }
.list-check li { list-style: none; display: flex; gap: 12px; align-items: flex-start; font-size: 16px; color: var(--text-soft); }
.list-check .icon { width: 22px; height: 22px; color: var(--gold); margin-top: 2px; }

/* ── Bande de téléchargement (CTA) ───────────────────────────────────────── */
.cta {
  background: var(--forest); color: #fff; border-radius: var(--r-lg);
  padding: 56px; text-align: center; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.cta h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(26px, 3.6vw, 40px); }
.cta p { color: rgba(255,255,255,0.78); margin-top: 12px; }
.cta .btn { margin-top: 28px; }
.dl-btns { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.dl-btns .btn { margin-top: 28px; }

/* ── Pied de page ────────────────────────────────────────────────────────── */
.footer { background: var(--ink); color: rgba(255,255,255,0.62); padding: 56px 0 30px; }
.footer .top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer .name { font-family: 'Fraunces', serif; color: #fff; font-size: 20px; }
.footer .ar { color: var(--gold-soft); font-size: 14px; margin-top: 2px; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer nav a { color: rgba(255,255,255,0.72); font-size: 14px; }
.footer nav a:hover { color: var(--gold); }
.footer .bottom { padding-top: 22px; font-size: 13px; }

/* ── En-tête de page interne ─────────────────────────────────────────────── */
.page-hero { position: relative; color: #fff; overflow: hidden; background: var(--forest); }
.page-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.28; }
.page-hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,28,22,0.7), rgba(8,28,22,0.9)); }
.page-hero .container { position: relative; z-index: 2; padding: 120px 24px 56px; text-align: center; }
.page-hero h1 { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(30px, 4.6vw, 50px); }
.page-hero p { margin-top: 12px; color: rgba(255,255,255,0.78); font-size: 16px; max-width: 48ch; margin-left: auto; margin-right: auto; }

/* ── Pages légales ───────────────────────────────────────────────────────── */
.legal { padding: 64px 0 40px; }
.legal-item { padding: 26px 0; border-bottom: 1px solid var(--line); }
.legal-item:last-child { border-bottom: none; }
.legal-item h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px; color: var(--forest-2); display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.legal-num { color: var(--gold); font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif; min-width: 22px; }
.legal-item p { font-size: 16px; color: var(--text-soft); white-space: pre-line; }

/* ── Formulaire ──────────────────────────────────────────────────────────── */
.form-wrap { max-width: 720px; margin: 0 auto; padding: 56px 0 30px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.fcard > .q { font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px; margin-bottom: 4px; }
.fcard > .q-sub { font-size: 14px; color: var(--text-soft); margin-bottom: 18px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,162,76,0.15); }
textarea { min-height: 96px; resize: vertical; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 14px; color: var(--text-soft); transition: all .14s ease;
}
.choice input { display: none; }
.choice:hover { border-color: var(--gold); }
.choice.checked { background: var(--forest-2); border-color: var(--forest-2); color: #fff; }

.modes { display: inline-flex; gap: 6px; padding: 5px; background: var(--paper-2); border-radius: 999px; margin-bottom: 14px; }
.mode-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px; border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-soft);
}
.mode-btn .icon { width: 16px; height: 16px; }
.mode-btn.active { background: #fff; color: var(--forest-2); box-shadow: var(--shadow-sm); }
.text-box.hide { display: none; }
.voice-box { display: none; }
.voice-box.show { display: block; }
.rec-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; border: none; font-family: inherit;
  padding: 12px 20px; border-radius: 999px; background: var(--gold); color: #1c2118; font-weight: 600; font-size: 14px;
}
.rec-btn.recording { background: #C0392B; color: #fff; }
.rec-btn .icon { width: 18px; height: 18px; }
.rec-status { font-size: 13px; color: var(--text-soft); }
audio { margin-top: 12px; width: 100%; }

.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-soft); margin: 4px 4px 22px; }
.consent input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--forest-2); }
.consent a { color: var(--forest-2); font-weight: 600; text-decoration: underline; }

.banner { display: none; padding: 15px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; }
.banner.show { display: block; }
.banner-error { background: #FBEAE7; color: #9B2C20; border: 1px solid #E8B7AE; }

.success { display: none; text-align: center; padding: 56px 28px; }
.success.show { display: block; }
.success .seal { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(200,162,76,0.5); color: var(--gold); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.success .seal .icon { width: 30px; height: 30px; }
.success h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 28px; color: var(--forest-2); margin-bottom: 10px; }
.success p { color: var(--text-soft); max-width: 40ch; margin: 0 auto 24px; }
