/* group.nextdata.ma — feuille de style unique.
   Couleurs reprises du logo NEXT DATA (rouge #f23f31, jaune #ffc603) et de l'en-tête
   sombre de nextdata.ma. Contrastes vérifiés par tests/test_contrast.py (AA).
   --red sert au décor et au texte sur fond sombre ; --red-ink au texte et aux boutons sur fond clair. */
:root {
  --navy: #0b1120;
  --navy-2: #111a30;
  --navy-3: #1b2742;
  --red: #f23f31;
  --red-ink: #c62a1d;
  --red-ink-hover: #a8200f;
  --yellow: #ffc603;
  --cyan: #38d6ef;
  --ink: #0f172a;
  --muted: #475569;
  --on-dark: #e7ecf7;
  --on-dark-muted: #9db0cc;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --tint: #fff5f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-title: 'Poppins', 'Inter', system-ui, sans-serif;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.65 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--red-ink); text-underline-offset: 3px; }
a:hover { color: var(--red-ink-hover); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
.light :focus-visible, .section :focus-visible, .form :focus-visible { outline-color: var(--navy); }
ul { padding-left: 1.2em; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }
.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; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--yellow); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 8px; color: var(--navy); }
main:focus { outline: none; }
.preview-banner { background: var(--yellow); color: var(--navy); text-align: center; font-weight: 600; font-size: .875rem; padding: 6px var(--gutter); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .75em 1.4em; border-radius: 10px; border: 2px solid transparent; font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red-ink); color: #fff; }
.btn-primary:hover { background: var(--red-ink-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.dark .btn-secondary, .btn-on-dark { color: #fff; border-color: rgba(255, 255, 255, .7); background: transparent; }
.dark .btn-secondary:hover, .btn-on-dark:hover { background: #fff; color: var(--navy); }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-yellow:hover { background: #ffd43b; color: var(--navy); }
.btn-sm { min-height: 40px; padding: .5em 1em; font-size: .95rem; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5rem; }
.actions-flush { margin-top: 0; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(11, 17, 32, .97); color: var(--on-dark); border-bottom: 1px solid rgba(255, 255, 255, .08); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(11, 17, 32, .9); backdrop-filter: blur(8px); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { border-radius: 6px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-title); font-size: 1.05rem; letter-spacing: .04em; }
.brand-text span { font-size: .75rem; color: var(--on-dark-muted); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a:not(.btn) { display: block; padding: 10px 12px; border-radius: 8px; color: var(--on-dark); text-decoration: none; font-weight: 500; font-size: .95rem; }
.site-nav a:not(.btn):hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--red); border-radius: 8px 8px 0 0; }
.site-nav { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; font: 600 .95rem var(--font); cursor: pointer; }
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1023px) {
  .header-inner { flex-wrap: wrap; }
  /* sans JavaScript, le menu reste affiché sous le logo */
  .no-js .site-nav { width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .no-js .site-nav ul { flex-direction: column; }
  .js .menu-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding: 4px 0 16px; }
  .js .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav a:not(.btn) { padding: 12px; font-size: 1rem; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--red); border-radius: 0 8px 8px 0; }
  .nav-cta { margin-top: 8px; }
}
@media (max-width: 379px) { .brand-text span { display: none; } }

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-soft { background: var(--bg-soft); }
.dark { background: var(--navy); color: var(--on-dark); }
.dark h1, .dark h2, .dark h3 { color: #fff; }
.dark a:not(.btn) { color: var(--yellow); }
.dark .muted, .dark .lead { color: var(--on-dark-muted); }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red-ink); margin-bottom: .75rem; }
.dark .eyebrow { color: var(--yellow); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.small { font-size: .875rem; }

/* Bandeau d'accueil */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); background: radial-gradient(1200px 500px at 85% -10%, rgba(56, 214, 239, .12), transparent 60%), var(--navy); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.25fr .75fr; } }
.hero h1 .accent { color: var(--yellow); }
.hero .lead { color: var(--on-dark-muted); }
.hero-art { display: none; }
@media (min-width: 960px) { .hero-art { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; aspect-ratio: 1; max-width: 360px; justify-self: end; width: 100%; } }
.hero-art span { border-radius: 18px; display: flex; align-items: flex-end; padding: 18px; font: 700 1.05rem var(--font-title); letter-spacing: .04em; }
.hero-art .b1 { background: var(--red); color: var(--navy); }
.hero-art .b2 { background: transparent; border: 2px solid rgba(255, 255, 255, .25); color: #fff; }
.hero-art .b3 { background: var(--yellow); color: var(--navy); }
.hero-art .b4 { background: var(--red); color: var(--navy); }
.hero-note { margin-top: 1.25rem; font-size: .9rem; color: var(--on-dark-muted); }
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); background: var(--navy); }
.breadcrumb { font-size: .875rem; margin-bottom: 1rem; color: var(--on-dark-muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }

/* Cartes */
.grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) and (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card h3 { margin-top: .25rem; }
.card ul { margin: 0 0 1.25rem; padding-left: 1.1em; }
.card li { margin-bottom: .35em; }
.card .card-link { margin-top: auto; font-weight: 600; }
.card-num { font: 700 .85rem var(--font-title); color: var(--red-ink); letter-spacing: .1em; }
.card-accent { border-top: 4px solid var(--red); }
.card-accent.y { border-top-color: var(--yellow); }
.card-accent.c { border-top-color: var(--cyan); }
.dark .card { background: var(--navy-2); border-color: rgba(255, 255, 255, .08); box-shadow: none; }
.dark .card .card-num { color: var(--yellow); }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--red-ink); margin-bottom: 12px; }
.icon svg { width: 24px; height: 24px; }

/* Listes à coches */
.checks { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.checks li { position: relative; padding-left: 30px; margin-bottom: .55em; }
.checks li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23c62a1d'%3E%3Cpath d='M8.1 13.4 4.7 10l-1.1 1.1 4.5 4.5 9-9-1.1-1.1z'/%3E%3C/svg%3E") center/14px no-repeat; }
.dark .checks li::before { background-color: rgba(255, 198, 3, .15); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffc603'%3E%3Cpath d='M8.1 13.4 4.7 10l-1.1 1.1 4.5 4.5 9-9-1.1-1.1z'/%3E%3C/svg%3E"); }

/* Étapes */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 16px; }
@media (min-width: 900px) { .steps-5 { grid-template-columns: repeat(5, 1fr); } .steps-4 { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 700 1.6rem var(--font-title); color: var(--red); margin-bottom: 6px; }
.steps h3 { font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Encadré humain */
.callout { display: grid; gap: 16px; align-items: start; border-radius: var(--radius); padding: 24px; background: var(--tint); border-left: 5px solid var(--red-ink); }
@media (min-width: 720px) { .callout { grid-template-columns: auto 1fr; padding: 28px 32px; } }
.callout p:last-child { margin: 0; }
.callout .icon { background: #fff; margin: 0; }

/* Tableau comparatif */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table-wrap:focus-visible { outline-color: var(--navy); }
table.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .95rem; }
.compare caption { text-align: left; padding: 16px 20px; font-weight: 600; color: var(--muted); caption-side: top; }
.compare th, .compare td { padding: 14px 20px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--bg-soft); font-family: var(--font-title); font-size: 1rem; }
.compare tbody th { font-weight: 600; width: 22%; }
.formules { display: grid; gap: 20px; }
@media (min-width: 900px) { .formules { grid-template-columns: repeat(3, 1fr); } }
.formule .price { font: 600 1rem var(--font-title); color: var(--red-ink); margin: 0 0 .75rem; }

/* Bandeau d'appel */
.cta-band { border-radius: 20px; padding: clamp(28px, 5vw, 48px); background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%); color: var(--on-dark); display: grid; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 28px; background: var(--red); opacity: .9; transform: rotate(12deg); }
.cta-band > * { position: relative; z-index: 1; }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1fr auto; } .cta-band::after { right: 24px; top: -70px; } }
@media (max-width: 899px) { .cta-band::after { width: 90px; height: 90px; right: -30px; top: -30px; } }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--on-dark-muted); margin: 0; }

/* Double appel : entreprises / personnes */
.audiences { display: grid; gap: 20px; }
@media (min-width: 820px) { .audiences { grid-template-columns: 1fr 1fr; } }
.audience { border-radius: var(--radius); padding: 32px; }
.audience-company { background: var(--navy); color: var(--on-dark); }
.audience-company h3 { color: #fff; }
.audience-company p { color: var(--on-dark-muted); }
.audience-company .eyebrow { color: var(--yellow); }
.audience-learner { background: var(--tint); border: 1px solid #fbd5d1; }

/* Formulaire */
.form-layout { display: grid; gap: 32px; }
@media (min-width: 960px) { .form-layout { grid-template-columns: 1.4fr .9fr; align-items: start; } }
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); box-shadow: var(--shadow); }
.form-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row-2 { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 18px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--red-ink); }
.optional { font-weight: 400; color: var(--muted); font-size: .9rem; }
.hint { display: block; font-size: .875rem; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid #94a3b8; border-radius: 10px; font: 400 1rem var(--font); color: var(--ink); background: #fff; }
textarea { min-height: 140px; resize: vertical; }
select { -webkit-appearance: none; appearance: none; padding-right: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%230f172a'%3E%3Cpath d='M5.3 7.3 10 12l4.7-4.7 1.4 1.4L10 14.8 3.9 8.7z'/%3E%3C/svg%3E") right 14px center/18px no-repeat; }
[id] { scroll-margin-top: 88px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.js input:user-invalid, .js select:user-invalid, .js textarea:user-invalid { border-color: var(--red-ink); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.consent input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--red-ink); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 14px; font-weight: 600; min-height: 1.5em; }
.form-status.is-error { color: #fff; background: var(--red-ink); padding: 12px 16px; border-radius: 10px; }
.privacy-box { background: var(--bg-soft); border-radius: var(--radius); padding: 24px; font-size: .95rem; }
.privacy-box h2 { font-size: 1.15rem; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.contact-list strong { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hours { border-collapse: collapse; }
.hours td { padding: 2px 16px 2px 0; }
.offices { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.offices li { padding: 8px 16px; border-radius: 999px; background: var(--navy-2); color: #fff; font-weight: 600; }

/* Catalogue */
.catalog { display: grid; gap: 20px; }
@media (min-width: 820px) { .catalog { grid-template-columns: repeat(3, 1fr); } }
.catalog ul { list-style: none; padding: 0; margin: 0; }
.catalog li a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; }
.catalog li a:hover { color: var(--red-ink); }
.catalog li a::after { content: "↗"; color: var(--red-ink); }

/* Pied de page */
.site-footer { background: var(--navy); color: var(--on-dark-muted); padding: 56px 0 24px; font-size: .95rem; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--yellow); text-decoration: underline; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-brand { font: 700 1.2rem var(--font-title); color: #fff; letter-spacing: .04em; margin-bottom: .5em; }
.footer-title { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 1em; font-family: var(--font); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 40px; padding-top: 20px; font-size: .875rem; }
.footer-bottom p { margin: 0; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.4rem; margin-top: 2rem; }
.section-subtitle { margin: 3rem 0 1.25rem; font-size: 1.4rem; }
.h3 { font-family: var(--font-title); font-size: 1.2rem; font-weight: 600; line-height: 1.2; margin: 0 0 .6em; }
address { font-style: normal; }
