/* ==========================================================================
   Avocat Fiscal Maroc — Feuille de style principale
   Sommaire : variables, reset, typography, header, hero, buttons, sections,
   cards, forms, FAQ, footer, mobile CTA bar, responsive, utilities, RTL
   ========================================================================== */

/* ---------- 1. Variables ---------- */
:root {
  --navy: #0B1F33;
  --navy-2: #163A59;
  --white: #FFFFFF;
  --grey-light: #F5F6F8;
  --text: #1D2733;
  --text-muted: #55626F;
  --gold: #B9975B;
  --gold-light: #D8C39A;
  --border: #E4E7EC;
  --success: #2E7D4F;
  --danger: #B3261E;
  --shadow-sm: 0 1px 3px rgba(11, 31, 51, 0.08);
  --shadow-md: 0 6px 24px rgba(11, 31, 51, 0.10);
  --shadow-lg: 0 16px 48px rgba(11, 31, 51, 0.16);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --container: 1180px;
  --header-h: 76px;
  --mobile-cta-h: 62px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-ar: 'Noto Sans Arabic', 'Inter', Arial, sans-serif;
}

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

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

/* ---------- 3. Typography ---------- */
body {
  font-family: var(--font-main);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body, .lang-ar body { font-family: var(--font-ar); }

h1, h2, h3, h4 { font-weight: 700; color: var(--navy); line-height: 1.25; }
h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 0.9rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
p { color: var(--text); }
.lead { font-size: 1.15rem; color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.section-head { max-width: 720px; margin: 0 auto 2.4rem; text-align: center; }
.section-head p { margin-top: 0.6rem; }

/* ---------- 4. Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
main { display: block; }
section { padding: 4rem 0; }
section.alt { background: var(--grey-light); }
.section-tight { padding: 2.6rem 0; }
.grid { display: grid; gap: 1.6rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 0.6rem; }
.gap-md { gap: 1.2rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
  top: 0; left: 0; background: var(--navy); color: var(--white);
  padding: 0.8rem 1.2rem; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { width: auto; height: auto; overflow: visible; clip: auto; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: #c9a76c; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-outline-navy { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: var(--white); }
.btn-whatsapp { background: #25D366; color: #05330f; }
.btn-whatsapp:hover { background: #1ebe5b; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-group { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* ---------- 6. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255,255,255,0.99);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; max-width: 1400px; }
.brand { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; min-width: 0; }
.brand img { height: 28px; width: auto; max-width: 100%; }
.brand-text { font-weight: 800; font-size: 1.05rem; color: var(--navy); }
.main-nav { display: flex; align-items: center; gap: 1.05rem; flex-wrap: nowrap; }
.main-nav a {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  padding: 0.4rem 0; position: relative; white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--navy-2); }
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--gold);
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.header-actions .btn-primary { padding: 0.6rem 1.1rem; font-size: 0.86rem; white-space: nowrap; }
.lang-switch { display: flex; gap: 0.25rem; font-size: 0.78rem; font-weight: 700; }
.lang-switch a { padding: 0.2rem 0.4rem; border-radius: 5px; color: var(--text-muted); }
.lang-switch a[aria-current="true"] { background: var(--navy); color: var(--white); }
.nav-toggle {
  display: none; background: none; border: none; padding: 0.5rem;
  width: 44px; height: 44px; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ""; display: block; width: 22px; height: 2px; background: var(--navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span { margin: 5px 0; }
.nav-toggle[aria-expanded="true"] span { opacity: 0; }
.nav-toggle[aria-expanded="true"]::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"]::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  padding: 3.6rem 0 4.2rem;
  position: relative;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: center; }
.hero-eyebrow { color: var(--gold-light); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.82rem; margin-bottom: 0.9rem; display: block; }
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero .lead { color: rgba(255,255,255,0.86); font-size: 1.12rem; max-width: 56ch; margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.hero-trust { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.88rem; color: rgba(255,255,255,0.75); }
.hero-trust span { display: flex; align-items: center; gap: 0.4rem; }
.hero-media { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.hero-sm { padding: 2.6rem 0 3rem; }
.hero-sm .hero-grid { grid-template-columns: 1fr; }
.hero-sm h1 { max-width: 46ch; }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 1rem; }
.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: var(--gold-light); text-decoration: underline; }
.breadcrumb-light { color: var(--text-muted); }
.breadcrumb-light a { color: var(--navy-2); }

/* ---------- 8. Sections & Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--grey-light); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; font-size: 1.4rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.96rem; }
.card-link { display: inline-block; margin-top: 0.9rem; font-weight: 700; color: var(--navy-2); font-size: 0.92rem; }
.card-link:hover { color: var(--gold); }

.practice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; min-width: 0; }
.split > * { min-width: 0; }
.grid > * { min-width: 0; }
.practice-grid > *, .steps-list > * { min-width: 0; }
.split-reverse { direction: rtl; }
.split-reverse > * { direction: ltr; }

.steps-list { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.step-item { position: relative; padding-top: 2.6rem; }
.step-item::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
html[dir="rtl"] .step-item::before { left: auto; right: 0; }

.badge-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.badge {
  background: var(--grey-light); border: 1px solid var(--border);
  padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--navy-2);
}

.callout {
  background: var(--grey-light);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.5rem;
  font-size: 0.96rem;
  color: var(--text-muted);
  margin: 1.6rem 0;
}
html[dir="rtl"] .callout { border-left: none; border-right: 4px solid var(--gold); }

.disclaimer {
  font-size: 0.86rem; color: var(--text-muted);
  background: var(--grey-light); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; margin-top: 1.4rem;
}

/* Article / guide content */
.article-content { max-width: 760px; margin: 0 auto; }
.article-content h2 { margin-top: 2.2rem; }
.article-content h3 { margin-top: 1.4rem; }
.article-content p { margin-bottom: 1rem; color: var(--text); }
.article-content ul { margin: 0 0 1.2rem; padding-left: 1.2rem; list-style: disc; }
html[dir="rtl"] .article-content ul { padding-left: 0; padding-right: 1.2rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: 0.92rem; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 0.6rem 0.8rem; text-align: left; }
html[dir="rtl"] .article-content th, html[dir="rtl"] .article-content td { text-align: right; }
.article-content th { background: var(--grey-light); }

.related-links { background: var(--grey-light); border-radius: var(--radius-md); padding: 1.6rem; margin-top: 2rem; }
.related-links h3 { margin-bottom: 0.8rem; }
.related-links ul { display: flex; flex-direction: column; gap: 0.5rem; }
.related-links a { color: var(--navy-2); font-weight: 600; }
.related-links a:hover { color: var(--gold); text-decoration: underline; }

.guide-index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.guide-index-grid a {
  display: block; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; font-weight: 600; color: var(--navy-2); font-size: 0.94rem;
}
.guide-index-grid a:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- 9. Forms ---------- */
.form-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-md);
}
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; color: var(--navy); }
.form-row .req { color: var(--danger); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 0.75rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.96rem; background: var(--white); color: var(--text);
  transition: border-color 0.15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--gold); outline: none; }
.form-row textarea { resize: vertical; min-height: 120px; }
.form-error { color: var(--danger); font-size: 0.82rem; margin-top: 0.3rem; display: none; }
.form-row.invalid input, .form-row.invalid textarea, .form-row.invalid select { border-color: var(--danger); }
.form-row.invalid .form-error { display: block; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.form-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 1rem; }
.form-success {
  display: none; background: #EAF6EF; color: var(--success); border: 1px solid #BFE3CC;
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-weight: 600; margin-bottom: 1.2rem;
}
.form-success.show { display: block; }

/* ---------- 10. FAQ ---------- */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%; background: none; border: none; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.3rem 0.2rem; font-weight: 700; font-size: 1.02rem; color: var(--navy);
}
html[dir="rtl"] .faq-question { text-align: right; }
.faq-question .icon { flex-shrink: 0; width: 22px; height: 22px; position: relative; }
.faq-question .icon::before, .faq-question .icon::after {
  content: ""; position: absolute; background: var(--gold); top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.faq-question .icon::before { width: 14px; height: 2px; }
.faq-question .icon::after { width: 2px; height: 14px; transition: transform 0.2s ease; }
.faq-question[aria-expanded="true"] .icon::after { transform: translate(-50%, -50%) rotate(90deg) scaleX(0); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-answer-inner { padding: 0 0.2rem 1.3rem; color: var(--text-muted); font-size: 0.96rem; }

/* ---------- 11. CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white); border-radius: var(--radius-lg);
  padding: 3rem; text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 60ch; margin: 0 auto 1.6rem; }
.cta-band .btn-group { justify-content: center; }
.cta-final { padding: 4rem 0; }

/* ---------- 12. Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.82); padding: 3.4rem 0 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 2.4rem; margin-bottom: 2.4rem; }
.footer-col h4 { color: var(--white); font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: 0.92rem; color: rgba(255,255,255,0.78); }
.footer-col a:hover { color: var(--gold-light); }
.footer-brand img { height: 34px; margin-bottom: 0.9rem; }
.footer-brand p { font-size: 0.88rem; color: rgba(255,255,255,0.65); margin-bottom: 0.4rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14); padding-top: 1.4rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
}
.footer-bottom a { color: rgba(255,255,255,0.7); }
.footer-bottom a:hover { color: var(--gold-light); }
.footer-legal-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ---------- 13. Mobile CTA bar ---------- */
.mobile-cta-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
  height: var(--mobile-cta-h);
  background: var(--white); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(11,31,51,0.12);
}
.mobile-cta-bar { grid-template-columns: repeat(2, 1fr); }
.mobile-cta-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 0.72rem; font-weight: 700; color: var(--navy);
  border-right: 1px solid var(--border);
}
html[dir="rtl"] .mobile-cta-bar a { border-right: none; border-left: 1px solid var(--border); }
.mobile-cta-bar a:last-child { border-right: none; }
.mobile-cta-bar a .emoji { font-size: 1.15rem; }
.mobile-cta-bar a.cta-whatsapp { color: #128C3E; }
.mobile-cta-bar a.cta-consult { color: var(--gold); background: var(--navy); }

/* ---------- 14. Responsive ---------- */
/* Le nombre de rubriques du menu principal est trop important pour tenir sur
   une seule ligne au sein du conteneur (1180px). Le menu bascule donc en
   version "hamburger" dès que l'espace horizontal devient insuffisant,
   plutôt que de forcer un menu tassé ou de casser la mise en page. */
@media (max-width: 1310px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 1024px) {
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-list { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .guide-index-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-actions { gap: 0.4rem; }
  .header-actions .btn-primary { display: none; }
  .lang-switch { gap: 0.2rem; font-size: 0.74rem; }
  .lang-switch a { padding: 0.2rem 0.35rem; }
  .brand img { height: 26px; }
  .site-header.nav-open .main-nav {
    display: flex; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--white); flex-direction: column; align-items: flex-start;
    padding: 1.4rem 1.25rem; gap: 0; overflow-y: auto; z-index: 490;
  }
  .site-header.nav-open .main-nav a { width: 100%; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media img { min-height: 220px; }
  .split { grid-template-columns: 1fr; gap: 1.6rem; }
  .split-reverse { direction: ltr; }
  body { padding-bottom: var(--mobile-cta-h); }
  .mobile-cta-bar { display: grid; }
  .form-cols { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  section { padding: 2.8rem 0; }
  .practice-grid, .grid-4, .grid-3, .grid-2, .steps-list, .guide-index-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .cta-band { padding: 2rem 1.4rem; }
  .hero { padding: 2.4rem 0 3rem; }
  .btn-group { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .hero-trust { flex-direction: column; gap: 0.5rem; }
  .header-actions { gap: 0.15rem; }
  .lang-switch { gap: 0.1rem; }
  .lang-switch a { padding: 0.2rem 0.3rem; }
  .nav-toggle { width: 38px; padding: 0.4rem; }
  .card { padding: 1.4rem; }
  .container { padding: 0 1rem; }
}

/* ---------- 15. Utilities ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-white { color: var(--white); }
.nowrap { white-space: nowrap; }
.sr-skip { position: absolute; top: -100px; }

/* ==========================================================================
   16. Génération de leads — Hero + formulaire (canal principal)
   Hiérarchie : 1. formulaire  2. WhatsApp  3. appel
   Objectif desktop : Hero + formulaire complet visibles sans scroll (1366×768)
   ========================================================================== */

/* --- Hero compact : l'image existante sert de fond --- */
.hero.hero-lead { padding: 1.75rem 0 2rem; }
.hero.hero-lead .hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 450px);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas: ". form" "intro form" "alt form" ". form";
  column-gap: clamp(2rem, 5vw, 4.5rem); row-gap: 0;
  align-items: start;
}
.hero.hero-lead .hero-grid > div:first-child { grid-area: intro; }
.hero.hero-lead .lead-card { grid-area: form; }
.hero.hero-lead .hero-alt { grid-area: alt; }
.hero.hero-lead .hero-grid > div:first-child, .hero.hero-lead .lead-card, .hero.hero-lead .hero-alt { position: relative; z-index: 1; }
.hero.hero-lead .hero-media {
  position: absolute; inset: 0; z-index: 0;
  border-radius: 0; box-shadow: none; pointer-events: none; overflow: hidden;
}
.hero.hero-lead .hero-media img { width: 100%; height: 100%; min-height: 0; object-fit: cover; opacity: 0.85; }
.hero.hero-lead::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(11,31,51,0.82) 0%, rgba(11,31,51,0.58) 50%, rgba(11,31,51,0.28) 100%);
}
.hero.hero-lead .hero-eyebrow { margin-bottom: 0.6rem; }
.hero.hero-lead h1 { font-size: clamp(1.9rem, 3vw, 2.55rem); line-height: 1.15; margin-bottom: 0.85rem; max-width: 24ch; }
.hero.hero-lead .lead { font-size: 1.06rem; margin-bottom: 1.3rem; max-width: 52ch; }
.hero.hero-lead .breadcrumb { margin-bottom: 0.8rem; }
.hero.hero-lead .breadcrumb-light, .hero.hero-lead .breadcrumb-light span { color: rgba(255,255,255,0.7); }
.hero.hero-lead .breadcrumb-light a { color: rgba(255,255,255,0.88); }
.hero.hero-lead .hero-trust { gap: 0.55rem; }
.hero.hero-lead .hero-trust span {
  padding: 0.38rem 0.85rem; border: 1px solid rgba(216,195,154,0.38);
  border-radius: 999px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.92);
  font-size: 0.86rem;
}

/* --- Alternatives secondaires (WhatsApp puis appel), sous le contenu du Hero --- */
.hero-alt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid rgba(255,255,255,0.14);
}
.hero-alt-label { color: rgba(255,255,255,0.78); font-size: 0.92rem; }
.hero-alt .btn { padding: 0.6rem 1.1rem; font-size: 0.92rem; }
.hero-alt .lead-call { width: 100%; margin: 0; font-size: 0.86rem; color: rgba(255,255,255,0.62); }
.hero-alt .lead-call a { color: rgba(255,255,255,0.88); font-weight: 600; white-space: nowrap; }
.hero-alt .lead-call a:hover { color: var(--gold-light); text-decoration: underline; }

/* --- Carte formulaire --- */
.lead-card {
  position: relative;
  background: var(--white); color: var(--text);
  border-radius: 14px; border-top: 4px solid var(--gold);
  box-shadow: 0 24px 60px rgba(4, 14, 26, 0.35);
  padding: 1.3rem 1.5rem 1.15rem;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.lead-card-page { border: 1px solid var(--border); border-top: 4px solid var(--gold); box-shadow: var(--shadow-md); padding: 1.6rem 1.7rem 1.4rem; }
.lead-card-head { margin-bottom: 0.85rem; }
.lead-card-title { font-size: 1.32rem; font-weight: 800; color: var(--navy); line-height: 1.2; letter-spacing: -0.01em; }
.lead-card-sub { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.45; }

.lead-form .form-row { margin-bottom: 0.6rem; }
.lead-form .form-cols { gap: 0 0.75rem; }
.lead-form .form-row label { font-size: 0.8rem; margin-bottom: 0.22rem; line-height: 1.3; }
.lead-form .form-row .opt { font-weight: 500; color: var(--text-muted); }
.lead-form .form-row input,
.lead-form .form-row select,
.lead-form .form-row textarea {
  font-size: 16px; /* évite le zoom automatique sur iOS */
  height: 44px; padding: 0.55rem 0.8rem; line-height: 1.35;
  background: #FBFBFC; border-color: #D5DBE3;
}
.lead-form .form-row textarea { height: auto; min-height: 72px; resize: vertical; }
.lead-form .form-row input:focus,
.lead-form .form-row select:focus,
.lead-form .form-row textarea:focus {
  background: var(--white); border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(185,151,91,0.25);
}
.lead-form .form-row input::placeholder, .lead-form .form-row textarea::placeholder { color: #8A96A3; }
.lead-form .form-row.invalid input, .lead-form .form-row.invalid select, .lead-form .form-row.invalid textarea {
  border-color: var(--danger); background: #FFF8F7;
}
.lead-form .form-error { font-weight: 600; font-size: 0.78rem; margin-top: 0.2rem; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn-submit {
  margin-top: 0.3rem; min-height: 50px; padding: 0.8rem 1.4rem;
  background: var(--navy); color: var(--white); border-color: var(--navy);
  font-size: 1.04rem; font-weight: 700; letter-spacing: 0.01em;
}
.btn-submit:hover { background: var(--navy-2); border-color: var(--navy-2); box-shadow: var(--shadow-md); }
.btn-submit::after { content: "→"; font-weight: 700; color: var(--gold-light); }
html[dir="rtl"] .btn-submit::after { content: "←"; }
.btn-submit[disabled] { opacity: 0.75; cursor: progress; }
.btn-submit[disabled]::after { content: ""; }

.form-status {
  margin-top: 0.6rem; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm);
  background: #FDECEA; color: var(--danger); font-size: 0.85rem; font-weight: 600;
}
.form-status[hidden] { display: none; }
.form-privacy {
  display: flex; align-items: flex-start; gap: 0.4rem;
  margin-top: 0.55rem; font-size: 0.78rem; color: var(--text-muted); line-height: 1.4;
}
.form-privacy svg { flex-shrink: 0; margin-top: 0.12rem; color: var(--gold); }
.lead-form .form-note { margin-top: 0.35rem; font-size: 0.78rem; }
.lead-form .form-note a { color: var(--navy-2); text-decoration: underline; }

.lead-assurance {
  display: flex; flex-wrap: wrap; gap: 0.3rem 1rem;
  margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 600; color: var(--navy-2);
}
.lead-assurance li { display: flex; align-items: center; gap: 0.3rem; }
.lead-assurance svg { color: var(--success); flex-shrink: 0; }

/* Confirmation après envoi */
.lead-success { text-align: center; padding: 2.2rem 0.5rem 1.6rem; }
.lead-success[hidden] { display: none; }
.lead-success:focus { outline: none; }
.lead-success-icon {
  width: 60px; height: 60px; margin: 0 auto 1rem; border-radius: 50%;
  background: #EAF6EF; color: var(--success);
  display: flex; align-items: center; justify-content: center;
}
.lead-success-icon svg { width: 30px; height: 30px; }
.lead-success-title { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.lead-success-text { color: var(--text-muted); margin-top: 0.35rem; }

/* WhatsApp en secondaire (bandeau CTA final + Hero) */
.btn .ico { flex-shrink: 0; }
.btn-wa-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.45); }
.btn-wa-outline .ico { color: #25D366; }
.btn-wa-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }

/* Barre mobile : formulaire d'abord, WhatsApp ensuite */
.mobile-cta-bar { grid-template-columns: 1.55fr 1fr; transition: transform 0.2s ease; }
.mobile-cta-bar a { flex-direction: row; gap: 0.45rem; font-size: 0.92rem; }
.mobile-cta-bar a.cta-whatsapp { border-right: none; border-left: 1px solid var(--border); }
html[dir="rtl"] .mobile-cta-bar a.cta-whatsapp { border-left: none; border-right: 1px solid var(--border); }
.mobile-cta-bar a.cta-consult { color: var(--white); }
.mobile-cta-bar a.cta-consult .emoji { color: var(--gold-light); font-size: 1.05rem; }
.mobile-cta-bar.is-hidden { transform: translateY(110%); }

/* Écrans larges et hauts : un peu plus d'air */
@media (min-width: 1200px) and (min-height: 860px) {
  .hero.hero-lead { padding: 2.6rem 0 2.9rem; }
  .lead-card { padding: 1.5rem 1.7rem 1.3rem; }
}
@media (max-width: 1024px) {
  .hero.hero-lead .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, 400px); }
}
@media (max-width: 860px) {
  .hero.hero-lead { padding: 1.5rem 0 2rem; }
  .hero.hero-lead .hero-grid {
    grid-template-columns: 1fr; grid-template-rows: none;
    grid-template-areas: "intro" "form" "alt"; row-gap: 1.3rem;
  }
  .hero.hero-lead .hero-media { order: 0; }
  .hero.hero-lead h1 { font-size: 1.62rem; margin-bottom: 0.65rem; max-width: none; }
  .hero.hero-lead .hero-eyebrow { margin-bottom: 0.45rem; }
  .hero.hero-lead .lead { font-size: 1rem; margin-bottom: 0.95rem; }
  .hero.hero-lead .breadcrumb { margin-bottom: 0.55rem; }
  .hero-alt { margin-top: 0; padding-top: 0; border-top: none; justify-content: center; text-align: center; }
  .hero-alt-label { width: 100%; }
  .hero-alt .btn { width: 100%; min-height: 48px; }
  .lead-card { padding: 1.25rem 1.1rem 1.1rem; }
  .lead-card-title { font-size: 1.26rem; }
  .lead-form .form-row input, .lead-form .form-row select { height: 48px; }
}
@media (max-width: 640px) {
  .hero.hero-lead .hero-trust { flex-direction: row; gap: 0.4rem; }
  .hero.hero-lead .hero-trust span { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
  .btn-wa-outline { white-space: normal; }
}
/* Écrans desktop peu hauts (1366×768, 1280×720) : la carte entière reste visible */
@media (min-width: 861px) and (max-height: 820px) {
  .hero.hero-lead { padding: 1.4rem 0 1.6rem; }
  .hero-lead .lead-assurance { display: none; } /* messages déjà portés par le sous-titre et la phrase de confidentialité */
}
/* Numéros de téléphone toujours lisibles de gauche à droite (pages en arabe) */
span[dir="ltr"] { direction: ltr; unicode-bidi: isolate; display: inline-block; }
html[dir="rtl"] .hero.hero-lead::after {
  background: linear-gradient(260deg, rgba(11,31,51,0.84) 0%, rgba(11,31,51,0.62) 50%, rgba(11,31,51,0.30) 100%);
}
