/* Aquila CMS — feuille de style du site public.
   Couleurs, polices, arrondis et largeur viennent de /admin/design (variables CSS injectées dans la page). */
:root {
  --primary: #F5B400; --primary-soft: rgba(245, 180, 0, .12); --on-primary: #0B0B0B;
  --bg: #0B0B0B; --bg-blur: rgba(11, 11, 11, .88); --surface: #141414; --line: #262626;
  --text: #F2F2F2; --muted: #A3A3A3; --radius: 18px; --max: 1120px; --logo-h: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ar: "Segoe UI", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; }
html[dir="rtl"] body { font-family: var(--font-ar); }
a { color: inherit; }
img { max-width: 100%; display: block; }
picture { display: contents; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
em { font-style: normal; color: var(--primary); }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg-blur); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { height: var(--logo-h); width: auto; max-width: 46vw; }
.brand-text { font-weight: 700; font-size: 20px; color: var(--primary); }
nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
nav .links { display: flex; align-items: center; gap: 22px; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover, nav a:focus-visible { color: var(--primary); }
.nav-logo img { height: 30px; width: auto; }
.langs { display: flex; gap: 4px; }
.langs a { border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; font-size: 12px; line-height: 1.4; }
.langs a[aria-current="true"] { border-color: var(--primary); color: var(--primary); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 36px; padding: 9px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
@media (max-width: 720px) {
  .menu-toggle { display: flex; }
  nav { gap: 10px; }
  nav .links { display: none; position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  nav .links a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .menu-open nav .links { display: flex; }
  .brand img { height: calc(var(--logo-h) * .85); }
}

/* Blocs : fonds et espacements choisis dans l'admin */
.block { padding: 72px 0; border-top: 1px solid var(--line); }
.block.block-hero { border-top: 0; }
.sp-compact { padding: 40px 0; }
.sp-large { padding: 112px 0; }
.sp-none { padding: 0; border-top: 0; }
.bg-surface { background: var(--surface); }
.bg-surface .card { background: var(--bg); }
.bg-accent { background: var(--primary-soft); }
.align-center { text-align: center; }
.align-center .lead, .align-center .prose { margin-inline: auto; }

/* Bannière d'accueil */
.block-hero.sp-normal { padding: 96px 0 72px; }
.hero .logo { width: min(560px, 90%); margin: 0 0 40px; }
.hero.align-center .logo { margin-inline: auto; }
.hero h1 { font-size: clamp(28px, 4.5vw, 48px); line-height: 1.15; margin: 0 0 18px; max-width: 820px; }
.hero.align-center h1, .hero.align-center p { margin-inline: auto; }
.hero p { color: var(--muted); font-size: 18px; max-width: 680px; margin: 0 0 32px; }

/* Boutons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.align-center .actions, .cta-box .actions { justify-content: center; }
.actions:empty { display: none; }
.btn { display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px; padding: 13px 24px; border-radius: 999px; border: 1px solid var(--primary); transition: opacity .15s; }
.btn:hover { opacity: .88; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.ghost { color: var(--primary); background: transparent; }

/* Titres et textes */
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 600; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; }
h2 { font-size: clamp(24px, 3vw, 34px); margin: 8px 0 14px; line-height: 1.25; }
.lead { color: var(--muted); max-width: 720px; margin: 0 0 36px; }
.prose { color: var(--muted); max-width: 760px; margin-bottom: 24px; }
.prose a, .lead a, .card p a { color: var(--primary); }

/* Cartes */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card-image img { border-radius: calc(var(--radius) - 6px); margin-bottom: 16px; width: 100%; height: auto; }
.card-link { display: inline-block; margin-top: 14px; color: var(--primary); text-decoration: none; font-weight: 600; font-size: 14px; }
.icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 20px; margin-bottom: 16px; }

/* Sociétés / applications */
.stack { display: grid; gap: 18px; }
.entity { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; }
.entity .mark { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; place-items: center; min-height: 120px; }
.entity .mark img { max-height: 90px; width: auto; }
.entity .mark img.faded { opacity: .35; max-height: 70px; }
.entity h3 { font-size: 22px; }
.entity p { margin-bottom: 18px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); margin: 0 0 12px; }
.badge.soon { background: var(--line); color: var(--muted); }
@media (max-width: 720px) { .entity { grid-template-columns: 1fr; } .entity .mark img { max-height: 72px; } }

/* Texte + image */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.split.image-start .split-media { order: -1; }
.split-media img { border-radius: var(--radius); width: 100%; height: auto; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .split.image-start .split-media { order: 0; } }

/* Chiffres clés */
.stats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { border-inline-start: 3px solid var(--primary); padding: 6px 18px; }
.stat strong { display: block; font-size: clamp(28px, 4vw, 40px); color: var(--primary); line-height: 1.2; }
.stat span { color: var(--muted); }

/* Appel à l'action */
.cta-box { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 24px; }
.cta-box p { color: var(--muted); max-width: 640px; margin: 0 auto 26px; }

/* Image */
.figure { margin: 0 auto; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); }
.figure figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 10px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 18px; align-items: start; }
.contact-grid.single { grid-template-columns: 1fr; max-width: 760px; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-details { list-style: none; margin: 0; display: grid; gap: 16px; }
.contact-details li span:first-child { display: block; color: var(--muted); font-size: 13px; }
.contact-details a { color: var(--primary); text-decoration: none; word-break: break-word; }
.contact-form { display: grid; gap: 14px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.contact-form input, .contact-form textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.contact-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .contact-form .two { grid-template-columns: 1fr; } }
.contact-form .btn { justify-self: start; cursor: pointer; font-family: inherit; }
.hint { color: var(--muted); font-size: 12px; margin-top: -6px; }
.field-error { color: #ff7b7b; }
.notice { border-radius: 10px; padding: 12px 14px; margin: 0; }
.notice.success { background: rgba(70, 200, 120, .14); color: #7be3a4; }
.notice.error { background: rgba(255, 90, 90, .12); color: #ff9b9b; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; }
.site-footer .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--primary); text-decoration: none; }
.foot-logos { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.foot-logos img { height: 30px; width: auto; opacity: .85; }
.foot-logos a:hover img { opacity: 1; }

/* Aperçu d'une page non publiée */
.preview-banner { background: var(--primary); color: var(--on-primary); text-align: center; font-size: 13px; font-weight: 600; padding: 6px; }

@media (max-width: 720px) {
  .block { padding: 56px 0; }
  .block-hero.sp-normal { padding: 64px 0 48px; }
}

/* Mode sombre / clair */
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); flex-shrink: 0; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--primary); color: var(--primary); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .moon path { fill: currentColor; stroke: none; }
[data-theme="dark"] .theme-toggle .moon, [data-theme="light"] .theme-toggle .sun { display: none; }
[data-theme="light"] .field-error { color: #C62828; }
[data-theme="light"] .notice.success { background: rgba(30, 142, 90, .1); color: #146C45; }
[data-theme="light"] .notice.error { background: rgba(198, 40, 40, .08); color: #A11F1F; }
/* Bulle WhatsApp (Réglages → Bulle WhatsApp) : en bas à droite, à gauche en arabe. */
.wa-bubble { position: fixed; z-index: 40; bottom: max(20px, env(safe-area-inset-bottom)); inset-inline-end: 20px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #25D366; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); transition: transform .15s ease; }
.wa-bubble:hover, .wa-bubble:focus-visible { transform: scale(1.07); color: #fff; outline: none; }
.wa-bubble svg { width: 32px; height: 32px; fill: currentColor; }
@media (max-width: 520px) { .wa-bubble { width: 52px; height: 52px; inset-inline-end: 14px; } .wa-bubble svg { width: 28px; height: 28px; } }
@media print { .wa-bubble { display: none; } }