/* Portail des services numériques — MCAT — Conception Soft Solutions SARL */
:root {
  --indigo: #1F3A68;
  --indigo-deep: #142850;
  --ochre: #C89A3C;
  --ochre-light: #E0B45A;
  --teal: #1F7A6F;
  --paper: #EEF2F6;
  --white: #FFFFFF;
  --ink: #1A2233;
  --ink-soft: #4B5566;
  --line: #D8DEE6;
  --radius: 14px;
  --radius-s: 8px;
  --max: 1180px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Public Sans", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--indigo-deep); margin: 0; line-height: 1.12; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 4px; }
main > section, .featured { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 15px/1 var(--font-text); text-decoration: none; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-deep); }
.btn-ghost { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn-ghost:hover { background: rgba(31,58,104,.08); }
.btn-link { background: transparent; color: var(--indigo); padding-left: 4px; padding-right: 4px; text-decoration: underline; text-underline-offset: 4px; }
.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- topbar ---------- */
/* bandeau officiel */
.govbar { background: #111; color: #fff; font-size: 13px; }
.govbar-in { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 7px 0; }
.govbar-flag { display: inline-flex; height: 12px; width: 27px; border-radius: 2px; overflow: hidden; }
.govbar-flag i { flex: 1; } .govbar-flag i:nth-child(1){background:#00853F} .govbar-flag i:nth-child(2){background:#FDEF42} .govbar-flag i:nth-child(3){background:#E31B23}
.govbar-right { margin-left: auto; color: rgba(255,255,255,.75); }
.topbar {
  display: flex; align-items: center; gap: 28px;
  width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; margin-right: auto; }
.brand img { height: 64px; width: auto; display: block; }
.brand-text { font-family: var(--font-display); font-size: 20px; color: var(--indigo-deep); border-left: 1px solid var(--line); padding-left: 18px; line-height: 1.2; }
.topnav { display: flex; gap: 22px; }
.topnav a { text-decoration: none; font-weight: 500; color: var(--ink-soft); font-size: 15px; }
.topnav a:hover { color: var(--indigo); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  padding: 48px 0 40px;
}
.hero-kicker { font: 600 14px/1 var(--font-text); color: var(--ochre); margin-bottom: 18px; letter-spacing: .01em; }
.hero h1 { font-size: clamp(32px, 4.2vw, 52px); font-weight: 600; letter-spacing: -.01em; max-width: 18ch; }
.hero-lead { margin-top: 20px; font-size: 18px; color: var(--ink-soft); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; align-items: center; }
.hero-facts-unused { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts dt { font: 600 14px/1.3 var(--font-text); color: var(--indigo); }
.hero-facts dd { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.hero-art { justify-self: end; width: 100%; max-width: 520px; }
.weave { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(20,40,80,.18)); }
.weave .weft rect { transform-origin: 0 50%; }
.weave .envelope { transform: translate(14px, 58px); }
.weave .stations > g { opacity: .95; }
@media (prefers-reduced-motion: no-preference) {
  .weave .weft rect { animation: weft-in .9s cubic-bezier(.2,.7,.2,1) both; }
  .weave .weft rect:nth-child(2) { animation-delay: .12s; }
  .weave .weft rect:nth-child(3) { animation-delay: .24s; }
  .weave .weft rect:nth-child(4) { animation-delay: .36s; }
  .weave .envelope { animation: travel 2.6s cubic-bezier(.4,0,.2,1) .6s both; }
  .weave .stations > g { opacity: 0; animation: fade .5s ease both; }
  .weave .stations > g:nth-child(1) { animation-delay: 1.0s; }
  .weave .stations > g:nth-child(2) { animation-delay: 1.6s; }
  .weave .stations > g:nth-child(3) { animation-delay: 2.2s; }
  .weave .stations > g:nth-child(4) { animation-delay: 2.8s; }
}
@keyframes weft-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes travel {
  0%   { transform: translate(14px, 58px); }
  28%  { transform: translate(14px, 58px); }
  40%  { transform: translate(150px, 148px); }
  58%  { transform: translate(150px, 148px); }
  70%  { transform: translate(290px, 238px); }
  86%  { transform: translate(290px, 238px); }
  100% { transform: translate(420px, 328px); }
}
@keyframes fade { to { opacity: .95; } }

/* ---------- cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--font-text); }
.badge-new, .badge-ok { background: #E3F3EF; color: var(--teal); }
.badge-soon { background: #FBF1DB; color: #8A6519; }
.badge-plan { background: #E9EDF3; color: var(--ink-soft); }

/* ---------- help ---------- */
.help { padding: 24px 0 64px; }
.help-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--ochre); border-radius: var(--radius); padding: 30px 34px; }
.help-card h2 { font-size: 26px; margin-bottom: 8px; }
.help-card p { color: var(--ink-soft); }
.help-contacts { display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.help-contacts a, .help-contacts span { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--indigo); }
.help-contacts .ico { width: 20px; height: 20px; }

/* ---------- footer ---------- */
.footer { background: var(--indigo-deep); color: rgba(255,255,255,.85); padding: 34px 0; margin-top: 10px; }
.footer-cols { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 24px; align-items: start; font-size: 14px; }
.footer-cols div { display: flex; flex-direction: column; gap: 6px; }
.footer-cols strong { color: #fff; }
.footer .link { color: rgba(255,255,255,.85); text-align: left; }
.footer-credit { flex-direction: row !important; align-items: center; gap: 10px !important; }
.footer-credit img { border-radius: 4px; background: #fff; padding: 2px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(20,40,80,.55); }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(680px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: var(--radius); padding: 34px 36px; }
.modal-box h2 { font-size: 26px; margin-bottom: 12px; }
.modal-box p, .modal-box li { color: var(--ink); margin-bottom: 10px; font-size: 15px; }
.modal-box ul { padding-left: 20px; margin: 10px 0 18px; }
.modal-close .ico { width: 20px; height: 20px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--paper); cursor: pointer; font-size: 20px; display: grid; place-items: center; }
.muted { color: var(--ink-soft); font-size: 13px !important; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li:nth-child(2) { border-right: 0; margin-right: 0; }
  .card-featured { grid-template-columns: 1fr; }
  .card-featured-aside { flex-direction: row; flex-wrap: wrap; gap: 20px 32px; }
}
@media (max-width: 820px) {
  .topnav { display: none; }
  .brand-text strong { font-size: 13px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .hero-art { justify-self: center; max-width: 440px; }
  .hero-facts { grid-template-columns: 1fr; gap: 12px; }
  .feature-list { grid-template-columns: 1fr; }
  .help-card { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main > section, .featured, .topbar, .footer-cols { width: calc(100% - 32px); }
  .grid, .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line); }
  .card-featured-body { padding: 26px 22px; }
  .card-featured-aside { padding: 26px 22px; flex-direction: column; }
  .btn-login { padding: 10px 12px; } .btn-login span { display: none; }
}

/* ---------- annonces ---------- */
.annonces { margin-top: 30px; display: grid; gap: 12px; }
.annonce { display: flex; align-items: center; gap: 16px; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--ochre); border-radius: var(--radius-s); padding: 14px 18px; }
.annonce-tag { flex: none; background: var(--ochre); color: var(--indigo-deep); font: 700 12px/1 var(--font-text); padding: 6px 10px; border-radius: 999px; }
.annonce strong { color: var(--indigo-deep); }
.annonce p { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.annonce .btn { flex: none; margin-left: auto; padding: 9px 14px; font-size: 14px; }

/* ---------- applications ---------- */
.apps { padding: 52px 0 16px; }
.section-head { max-width: 62ch; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); }
.section-head p { margin-top: 10px; color: var(--ink-soft); font-size: 17px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filters button { border: 1.5px solid var(--line); background: var(--white); color: var(--ink-soft); font: 500 14px/1 var(--font-text); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.filters button[aria-selected="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.domaine { margin-bottom: 34px; }
.domaine-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--indigo); }
.domaine-head h3 { font-size: 21px; }
.domaine-head p { color: var(--ink-soft); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.card-app {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px 22px 20px; min-height: 212px;
  text-decoration: none; text-align: left; color: var(--ink); font-family: var(--font-text); cursor: pointer;
  transition: border-color .18s ease;
}
.card-app .ico { width: 30px; height: 30px; color: var(--indigo); stroke-width: 1.75; margin-bottom: 4px; }
.card-app h3 { font-size: 19px; font-weight: 600; }
.card-app .produit { font: 600 11px/1 var(--font-text); color: var(--teal); letter-spacing: .04em; }
.card-app p { font-size: 14px; color: var(--ink-soft); flex: 1; text-align: left; }
.card-app .badge { margin-top: 8px; }
.card-app:hover { border-color: var(--indigo); }
.card-app[data-soon] .ico { color: var(--ink-soft); }
.card-app.is-new { border-color: var(--ochre); box-shadow: 0 16px 36px -24px rgba(200,154,60,.6); }
.ribbon { position: absolute; top: 14px; right: 14px; background: var(--ochre); color: var(--indigo-deep); font: 700 11px/1 var(--font-text); padding: 5px 9px; border-radius: 999px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--font-text); }
.badge-ok { background: #E3F3EF; color: var(--teal); }
.badge-soon { background: #FBF1DB; color: #8A6519; }
.badge-plan { background: #E9EDF3; color: var(--ink-soft); }

/* ---------- fonctionnement ---------- */
.how { padding: 36px 0 24px; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--indigo); }
.how-item { padding: 22px 22px 22px 0; margin-right: 22px; border-right: 1px solid var(--line); }
.how-item:last-child { border-right: 0; margin-right: 0; }
.how-item .ico { width: 28px; height: 28px; color: var(--ochre); stroke-width: 1.75; margin-bottom: 12px; }
.how-item h3 { font-size: 19px; margin-bottom: 8px; }
.how-item p { font-size: 14.5px; color: var(--ink-soft); }

.footer-brand img { background: #fff; border-radius: 6px; padding: 6px; width: 120px; height: auto; margin-bottom: 4px; }

@media (max-width: 1024px) { .grid, .how-grid { grid-template-columns: repeat(2, 1fr); } .how-item:nth-child(2) { border-right: 0; margin-right: 0; } }
@media (max-width: 820px) { .govbar-right { display: none; } .brand img { height: 52px; } .brand-text { font-size: 16px; } .annonce { flex-wrap: wrap; } .annonce .btn { margin-left: 0; } }
@media (max-width: 560px) { .grid, .how-grid { grid-template-columns: 1fr; } .how-item { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line); } .brand-text { display: none; } }

/* v7 — cartes d'applications plus grandes, réparties sur toute la largeur, texte justifié */
.grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }
.card-app { padding: 34px 34px 30px; min-height: 300px; gap: 10px; border-radius: 18px; }
.card-app .ico { width: 44px; height: 44px; margin-bottom: 8px; }
.card-app h3 { font-size: 26px; line-height: 1.15; }
.card-app .produit { font-size: 12px; letter-spacing: .08em; }
.card-app p { font-size: 16px; line-height: 1.6; text-align: justify; hyphens: auto; }
.card-app .badge { margin-top: 12px; font-size: 13px; padding: 7px 16px; }
.card-app:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -26px rgba(20,40,80,.45); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } .card-app { min-height: 0; padding: 26px 22px; } .card-app h3 { font-size: 22px; } }
/* v8 — annonce avec plusieurs liens */
.annonce-liens { flex: none; margin-left: auto; display: flex; flex-direction: column; gap: 8px; }
.annonce-liens .btn { margin-left: 0; white-space: nowrap; }
@media (max-width: 820px) { .annonce-liens { margin-left: 0; flex-direction: row; flex-wrap: wrap; } }
/* v9 — diaporama du Ministère en images (hero) */
.hero-slides { position: relative; aspect-ratio: 13 / 10; max-width: 560px; border-radius: 22px; overflow: hidden; box-shadow: 0 28px 60px -30px rgba(20,40,80,.55); background: #142850; }
.hero-slides .slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-slides .slide.on { opacity: 1; }
.hero-slides .slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.04); transition: transform 7s linear; }
.hero-slides .slide.on img { transform: scale(1.12); }
.hero-slides figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 22px 18px; color: #fff; font: 600 15px/1.3 var(--font-text); background: linear-gradient(180deg, rgba(20,40,80,0) 0%, rgba(20,40,80,.78) 100%); letter-spacing: .2px; }
.hero-slides figcaption::before { content: ""; display: block; width: 36px; height: 4px; background: var(--ochre); border-radius: 2px; margin-bottom: 8px; }
.slide-dots { position: absolute; right: 16px; top: 16px; display: flex; gap: 6px; z-index: 2; }
.slide-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; transition: transform .2s, background .2s; }
.slide-dots button.on { background: var(--ochre); transform: scale(1.35); }
@media (prefers-reduced-motion: reduce) { .hero-slides .slide img, .hero-slides .slide.on img { transform: none; transition: none; } }
