/* Université Académique de Madagascar Ambohidratrimo — inspiré de « The East West University Website Redesign » */
:root {
  --navy: #173B66;
  --navy-dark: #0F2847;
  --teal: #1A99A5;
  --gold: #C59A45;
  --gold-light: #F1C75B;
  --offwhite: #EFEDEE;
  --grey: #ACACA8;
  --red: #A53128;
  --ink: #161A22;
  --muted: #5F6672;
  --line: #DCDFDC;
  --white: #fff;
  /* Couleurs qui changent avec le thème clair / sombre */
  --bg: #fff;
  --surface: #fff;
  --heading: #173B66;
  --radius: 14px;
  --shadow: 0 20px 50px -20px rgba(15, 40, 71, .35);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1200px;
}

/* ---------- Mode sombre (data-theme="dark" posé par js/theme.js) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;
  --surface: #121B2B;
  --offwhite: #0F1828;
  --line: #243149;
  --ink: #E6EBF2;
  --muted: #9AA7BA;
  --heading: #E8EEF8;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .7);
}
:root[data-theme="dark"] .notice { background: #2a1717; color: #f2c4bf; }
:root[data-theme="dark"] .chat-log, :root[data-theme="dark"] .chat-sugg, :root[data-theme="dark"] .wz-nav { background: #0F1828; }
:root[data-theme="dark"] .success .num, :root[data-theme="dark"] .tags span { background: #1a2538; }
:root[data-theme="dark"] .search-mini input { background: var(--surface); color: var(--ink); }
:root[data-theme="dark"] #header.scrolled .mainnav { background: rgba(18, 27, 43, .92); }
:root[data-theme="dark"] .quick .ico { background: rgba(26,153,165,.2); }
:root[data-theme="dark"] .split-img img, :root[data-theme="dark"] .card-img img { filter: brightness(.92); }

/* Bouton clair / sombre */
.theme-toggle { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s, color .2s; }
.theme-toggle:hover { background: rgba(255,255,255,.12); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
#header.scrolled .theme-toggle { color: var(--heading); border-color: var(--line); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); transition: background .3s, color .3s; line-height: 1.6; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { font-family: var(--serif); color: var(--heading); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: .95rem; border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .2s, color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold-light); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold); box-shadow: 0 8px 20px -8px rgba(197,154,69,.8); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); }
.btn-outline { border-color: var(--heading); color: var(--heading); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: var(--surface); color: var(--heading); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- En-tête ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: stretch; justify-content: space-between; min-height: 96px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-tile { background: var(--navy); display: grid; place-items: center; width: 96px; height: 96px; flex-shrink: 0; }
.brand-tile img { width: 88px; }
.brand-name { line-height: 1.15; font-weight: 800; letter-spacing: .08em; font-size: .92rem; color: var(--heading); }
.brand-name span { display: block; color: var(--gold); }
.top-right { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 10px; }
.utility { display: flex; gap: 22px; font-size: .85rem; color: var(--muted); }
.utility a:hover { color: var(--heading); }
.search-mini { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.search-mini input { border: 0; padding: 7px 12px; width: 220px; outline: none; font-size: .88rem; }
.search-mini button { background: var(--navy); color: #fff; border: 0; padding: 8px 12px; cursor: pointer; }

.mainnav { background: var(--navy); position: relative; box-shadow: 0 2px 12px rgba(0,0,0,.12); transition: background .35s ease, box-shadow .35s ease; }

/* En-tête fixe qui suit le défilement ; au-delà du haut de page il devient compact et clair. */
#header { position: fixed; top: 0; left: 0; right: 0; z-index: 60; }
body { padding-top: 150px; }
[id] { scroll-margin-top: 80px; }
.topbar { max-height: 97px; overflow: hidden; transition: max-height .35s ease, opacity .25s ease; }
.nav-brand { display: none; align-items: center; gap: 8px; margin-right: 10px; font-weight: 800; font-size: .8rem; letter-spacing: .08em; color: var(--heading); white-space: nowrap; }
.nav-brand img { width: 34px; height: 34px; }
#header.scrolled .topbar { max-height: 0; opacity: 0; border-bottom: 0; }
#header.scrolled .mainnav { background: rgba(255,255,255,.93); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 8px 28px -12px rgba(15,40,71,.4); }
#header.scrolled .nav-brand { display: flex; }
#header.scrolled .mainnav li a { color: var(--heading); }
#header.scrolled .mainnav li a:hover, #header.scrolled .mainnav li a.active { color: var(--heading); background: rgba(23,59,102,.07); }
#header.scrolled .burger { color: var(--heading); }
.mainnav .wrap { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.mainnav ul { display: flex; list-style: none; height: 100%; }
.mainnav li a { display: flex; align-items: center; height: 54px; padding: 0 16px; color: #e5ecf5; font-size: .92rem; font-weight: 500; position: relative; }
.mainnav li a:hover, .mainnav li a.active { color: #fff; background: rgba(255,255,255,.07); }
.mainnav li a.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 3px; background: var(--gold-light); }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-cta .btn { padding: 8px 18px; font-size: .88rem; }
.burger { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 600px; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.05); animation: slowzoom 18s ease-out forwards; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,40,71,.55) 0%, rgba(15,40,71,.1) 60%); }
@keyframes slowzoom { to { transform: scale(1); } }
.hero .wrap { position: relative; width: 100%; padding-top: 60px; padding-bottom: 60px; }
.hero-card { background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-radius: var(--radius); padding: 38px 36px 30px; max-width: 520px; box-shadow: var(--shadow); animation: rise .8s ease both .2s; }
.hero-card p { color: var(--muted); margin: 12px 0 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 8px 0; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; font-family: var(--serif); font-size: 1rem; }
.tabs button.on { color: var(--heading); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--navy); }
.finder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--heading); }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: var(--surface); color: var(--ink); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(26,153,165,.15); }
.finder .btn { grid-column: 1 / -1; justify-content: center; margin-top: 4px; }
.hero-note { font-size: .8rem; color: var(--muted); margin-top: 12px; }
.hero-note b { color: var(--red); }

/* ---------- Bandeau chiffres ---------- */
.stats { background: var(--navy); color: #fff; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 30px 20px; border-right: 1px solid rgba(255,255,255,.12); }
.stat:last-child { border-right: 0; }
.stat strong { font-family: var(--serif); font-size: 2.2rem; color: var(--gold-light); display: block; line-height: 1; }
.stat span { font-size: .9rem; color: #c9d5e5; }

/* ---------- Sections ---------- */
section.block { padding: 90px 0; }
section.alt { background: var(--offwhite); }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.head-center { text-align: center; margin: 0 auto 44px; max-width: 700px; }
.head-center .lead { margin: 10px auto 0; }

/* Raccourcis « Vous cherchez peut-être » */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.quick a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; transition: .2s; display: block; }
.quick a:hover { border-color: var(--teal); transform: translateY(-4px); box-shadow: var(--shadow); }
.quick .ico { width: 46px; height: 46px; border-radius: 10px; background: rgba(26,153,165,.12); color: var(--teal); display: grid; place-items: center; margin-bottom: 14px; }
.quick h3 { font-size: 1.08rem; margin-bottom: 4px; }
.quick p { font-size: .88rem; color: var(--muted); }

/* Cartes formations */
.filter { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 16px; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: .2s; }
.chip.on, .chip:hover { background: var(--navy); color: #fff; border-color: var(--heading); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: .25s; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-img { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--offwhite); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.06); }
.badge { position: absolute; top: 12px; left: 12px; background: var(--gold-light); color: var(--navy-dark); font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: .06em; }
.badge.teal { background: var(--teal); color: #fff; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body p { font-size: .9rem; color: var(--muted); flex: 1; }
.card-meta { font-size: .8rem; color: var(--teal); font-weight: 600; }
.more { font-weight: 600; color: var(--heading); font-size: .9rem; display: inline-flex; gap: 6px; align-items: center; }
.more:hover { color: var(--teal); }

/* Split / à propos */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 60px; align-items: center; }
.split-img { position: relative; }
.split-img img { border-radius: var(--radius); aspect-ratio: 5/4; object-fit: cover; width: 100%; }
.split-img .float { position: absolute; bottom: -26px; right: -20px; background: var(--gold-light); color: var(--navy-dark); padding: 20px 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.split-img .float strong { font-family: var(--serif); font-size: 1.8rem; display: block; line-height: 1; }
.checks { list-style: none; margin: 22px 0 28px; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }

/* Valeurs */
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.value { background: var(--surface); border-radius: var(--radius); padding: 28px 22px; border-top: 4px solid var(--teal); }
.value:nth-child(2) { border-color: var(--gold); }
.value:nth-child(3) { border-color: var(--heading); }
.value:nth-child(4) { border-color: var(--red); }
.value p { color: var(--muted); font-size: .92rem; margin-top: 6px; }

/* Étapes admission (accueil) */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
.step { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 28px; counter-increment: s; }
.step::before { content: counter(s, decimal-leading-zero); font-family: var(--serif); font-size: 2.2rem; color: var(--gold-light); display: block; margin-bottom: 10px; }
.step h3 { color: #fff; }
.step p { color: #c9d5e5; font-size: .92rem; margin-top: 6px; }
.dark { background: var(--navy-dark) radial-gradient(circle at 85% 10%, rgba(26,153,165,.35), transparent 40%); color: #fff; }
.dark h2 { color: #fff; }
.dark .lead { color: #c9d5e5; }

/* Actualités */
.news { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news .card-body time { font-size: .8rem; color: var(--muted); }

/* Bandeau appel à l'action */
.cta-band { background: linear-gradient(120deg, var(--teal), var(--navy)); color: #fff; border-radius: 20px; padding: 50px; display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #e3f1f3; margin-top: 8px; }

/* En-tête de page interne */
.page-hero { position: relative; padding: 90px 0 70px; color: #fff; background-size: cover; background-position: center; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,40,71,.92), rgba(15,40,71,.55)); }
.page-hero .wrap { position: relative; }
.page-hero h1 { color: #fff; }
.page-hero p { color: #dbe4ef; max-width: 640px; margin-top: 12px; font-size: 1.08rem; }
.crumbs { font-size: .85rem; color: #b8c6d8; margin-bottom: 14px; }
.crumbs a:hover { color: #fff; }

/* Détail formation */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 50px; align-items: start; }
.detail h2 { font-size: 1.6rem; margin: 34px 0 14px; }
.detail h2:first-child { margin-top: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { background: var(--offwhite); padding: 7px 14px; border-radius: 8px; font-size: .9rem; }
.aside { position: sticky; top: 80px; background: var(--offwhite); border-radius: var(--radius); padding: 28px; }
.aside dl { display: grid; gap: 14px; margin: 16px 0 24px; }
.aside dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.aside dd { font-weight: 600; color: var(--heading); }

/* Simulation */
.notice { background: #fdf3f2; border-left: 4px solid var(--red); padding: 16px 20px; border-radius: 8px; color: #6b211b; font-size: .94rem; }
.wizard { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.progress { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--offwhite); }
.progress div { padding: 16px 10px; text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.progress div b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); margin: 0 auto 6px; font-size: .8rem; }
.progress div.on { color: var(--heading); border-color: var(--heading); }
.progress div.on b { background: var(--navy); color: #fff; border-color: var(--heading); }
.progress div.done b { background: var(--teal); color: #fff; border-color: var(--teal); }
.wz-body { padding: 36px; }
.wz-step { display: none; animation: rise .4s ease both; }
.wz-step.on { display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .full { grid-column: 1 / -1; }
.wz-nav { display: flex; justify-content: space-between; padding: 20px 36px; border-top: 1px solid var(--line); background: #fafafa; }
.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pick label { border: 2px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; transition: .2s; display: block; }
.pick label:hover { border-color: var(--teal); }
.pick input { position: absolute; opacity: 0; }
.pick input:checked + span { color: var(--heading); }
.pick label:has(input:checked) { border-color: var(--heading); background: rgba(23,59,102,.05); }
.pick small { display: block; color: var(--muted); font-size: .78rem; }
.pick-title { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); margin: 18px 0 10px; }
.docs { list-style: none; display: grid; gap: 10px; }
.docs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 12px 16px; border-radius: 10px; flex-wrap: wrap; }
.docs input[type=file] { font-size: .82rem; max-width: 240px; }
.recap { display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; font-size: .95rem; }
.recap dt { color: var(--muted); }
.recap dd { font-weight: 600; }
.success { text-align: center; padding: 20px 0; }
.success .num { font-family: var(--serif); font-size: 2rem; color: var(--heading); background: var(--offwhite); display: inline-block; padding: 10px 26px; border-radius: 10px; margin: 16px 0; letter-spacing: .05em; }
.err { color: var(--red); font-size: .85rem; margin-top: 10px; min-height: 1em; }

/* Contact & FAQ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
.info-list { display: grid; gap: 18px; margin-top: 24px; }
.info-list div { display: flex; gap: 14px; }
.info-list .ico { width: 44px; height: 44px; flex-shrink: 0; background: var(--navy); color: #fff; border-radius: 10px; display: grid; place-items: center; }
.info-list small { display: block; color: var(--muted); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.map { border: 0; width: 100%; height: 340px; border-radius: var(--radius); margin-top: 40px; filter: grayscale(.3); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
summary { padding: 18px 22px; cursor: pointer; font-weight: 600; color: var(--heading); list-style: none; display: flex; justify-content: space-between; gap: 10px; }
summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--teal); }
details[open] summary::after { content: "–"; }
details p { padding: 0 22px 18px; color: var(--muted); }

/* Connexion */
.login { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1fr 1fr; }
.login-visual { background: linear-gradient(rgba(15,40,71,.82), rgba(15,40,71,.9)), url("/assets/img/uama/amphi.jpg") center/cover; color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: flex-end; }
.login-visual h2 { color: #fff; }
.login-visual p { color: #c9d5e5; margin-top: 10px; max-width: 420px; }
.login-form { display: grid; place-items: center; padding: 40px 20px; background: var(--offwhite); }
.login-form form { width: 100%; max-width: 400px; background: var(--surface); padding: 36px; border-radius: 20px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.roles label { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.roles input { position: absolute; opacity: 0; }
.roles label:has(input:checked) { border-color: var(--heading); color: var(--heading); background: rgba(23,59,102,.05); }

/* Galerie */
.gallery { columns: 3 260px; column-gap: 16px; }
.gallery img { border-radius: 12px; margin-bottom: 16px; width: 100%; break-inside: avoid; }

/* ---------- Pied de page ---------- */
footer { background: var(--navy-dark); color: #b8c6d8; padding: 70px 0 0; margin-top: 0; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.foot h4 { color: #fff; font-size: .95rem; margin-bottom: 16px; }
.foot ul { list-style: none; display: grid; gap: 9px; font-size: .92rem; }
.foot a:hover { color: var(--gold-light); }
.foot-brand img { width: 290px; margin-bottom: 16px; }
.foot-brand p { font-size: .92rem; max-width: 320px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 50px; padding: 22px 0; display: flex; justify-content: space-between; font-size: .84rem; flex-wrap: wrap; gap: 10px; }

/* ---------- Chatbot ---------- */
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 60px; height: 60px; border-radius: 50%; background: var(--teal); color: #fff; border: 0; cursor: pointer; box-shadow: 0 10px 30px -8px rgba(26,153,165,.8); display: grid; place-items: center; transition: transform .2s; }
.chat-fab:hover { transform: scale(1.07); }
.chat { position: fixed; right: 22px; bottom: 94px; z-index: 90; width: 360px; max-width: calc(100vw - 32px); height: 500px; max-height: calc(100vh - 120px); background: var(--surface); border-radius: 18px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.4); display: none; flex-direction: column; overflow: hidden; }
.chat.open { display: flex; animation: rise .3s ease both; }
.chat-head { background: var(--navy); color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.chat-head img { width: 34px; background: var(--surface); border-radius: 8px; padding: 3px; }
.chat-head small { display: block; color: #b8c6d8; font-size: .76rem; }
.chat-head button { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f7f8fa; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .9rem; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg a { color: var(--teal); font-weight: 600; text-decoration: underline; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin-bottom: 0; } .msg ul { margin: 4px 0 6px; padding-left: 18px; } .msg.typing { color: var(--muted); letter-spacing: 2px; }
.chat-sugg { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 16px; background: #f7f8fa; }
.chat-sugg button { border: 1px solid var(--teal); color: var(--teal); background: var(--surface); border-radius: 99px; padding: 5px 11px; font-size: .78rem; cursor: pointer; }
.chat form { display: flex; border-top: 1px solid var(--line); }
.chat input { flex: 1; border: 0; padding: 14px; outline: none; }
.chat form button { background: none; border: 0; color: var(--heading); padding: 0 16px; cursor: pointer; font-weight: 700; }

/* Animations au défilement */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .quick, .values { grid-template-columns: repeat(2, 1fr); }
  .foot { grid-template-columns: 1fr 1fr; }
  .mainnav li a { padding: 0 10px; font-size: .86rem; }
  .pick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .utility, .search-mini { display: none; }
  .topbar .wrap { min-height: 72px; padding-right: 16px; padding-left: 0; }
  .brand-tile { width: 72px; height: 72px; }
  .brand-tile img { width: 66px; }
  .burger { display: block; }
  .mainnav ul { display: none; position: absolute; top: 54px; left: 0; right: 0; background: var(--navy); flex-direction: column; height: auto; padding: 8px 0 16px; box-shadow: 0 20px 30px rgba(0,0,0,.2); }
  .mainnav ul.open { display: flex; }
  body { padding-top: 126px; }
  .topbar { max-height: 73px; }
  #header.scrolled .mainnav ul { background: var(--surface); }
  .mainnav li a { height: 46px; padding: 0 20px; }
  .mainnav li a.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  .split, .detail, .contact-grid, .login { grid-template-columns: 1fr; }
  .split-img .float { right: 10px; }
  .login-visual { display: none; }
  .news, .steps { grid-template-columns: 1fr; }
  .stats .wrap { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat { border-bottom: 1px solid rgba(255,255,255,.12); }
  .aside { position: static; }
  .progress div { font-size: 0; padding: 12px 4px; }
  .progress div b { font-size: .8rem; margin-bottom: 0; }
  section.block { padding: 64px 0; }
  .hero { min-height: auto; }
  .hero .wrap { padding-top: 160px; padding-bottom: 24px; }
  .cta-band { padding: 34px 26px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .cards, .quick, .values, .foot, .grid2, .finder, .pick { grid-template-columns: 1fr; }
  .hero-card { padding: 26px 20px; }
  .nav-cta .btn-outline-light { display: none; }
  .wz-body { padding: 24px 18px; }
  .wz-nav { padding: 16px 18px; }
  .recap { grid-template-columns: 1fr; gap: 2px; }
  .recap dd { margin-bottom: 10px; }
  .brand-name { font-size: .78rem; }
}

/* ---------- Animations & finitions (js/enhance.js) ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--teal), var(--gold-light)); pointer-events: none; }
.to-top { position: fixed; left: 22px; bottom: 22px; z-index: 80; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--navy); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .3s, transform .3s, background .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--teal); }

/* Formes flottantes dans les grands en-têtes */
.hero, .page-hero { overflow: hidden; }
.hero-deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero .wrap, .page-hero .wrap { z-index: 1; }
.hero-deco span { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: float-blob 14s ease-in-out infinite; }
.hero-deco span:nth-child(1) { width: 220px; height: 220px; right: 8%; top: 12%; background: radial-gradient(circle at 30% 30%, rgba(241,199,91,.55), transparent 70%); }
.hero-deco span:nth-child(2) { width: 140px; height: 140px; right: 30%; bottom: 8%; background: radial-gradient(circle at 30% 30%, rgba(26,153,165,.55), transparent 70%); animation-delay: -5s; animation-duration: 18s; }
.hero-deco span:nth-child(3) { width: 70px; height: 70px; right: 14%; bottom: 22%; border: 2px solid rgba(255,255,255,.35); background: none; animation-delay: -9s; animation-duration: 11s; }
@keyframes float-blob { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(-24px, 18px) scale(1.06); } 66% { transform: translate(16px, -14px) scale(.96); } }

/* En-têtes de page : entrée du titre */
.page-hero h1, .page-hero p, .page-hero .crumbs { animation: rise .7s ease both; }
.page-hero p { animation-delay: .12s; }
.page-hero .crumbs { animation-delay: .05s; }

/* Reflet lumineux au survol des cartes */
.card, .quick a, .value { position: relative; overflow: hidden; }
.card::after, .quick a::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%); transform: translateX(-120%); transition: transform .8s ease; pointer-events: none; }
.card:hover::after, .quick a:hover::after { transform: translateX(120%); }
.quick .ico { transition: transform .35s cubic-bezier(.2,.7,.2,1), background .3s; }
.quick a:hover .ico { transform: rotate(-8deg) scale(1.12); background: var(--teal); color: #fff; }

/* Titres de section : trait doré qui se dessine */
.head-center h2::after, .head h2::after { content: ""; display: block; width: 64px; height: 3px; margin-top: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--teal)); transform: scaleX(0); transform-origin: left; transition: transform .8s .25s ease; }
.head-center h2::after { margin-left: auto; margin-right: auto; transform-origin: center; }
.reveal.in h2::after, .head-center.in h2::after, .reveal h2.in::after { transform: scaleX(1); }

/* Bande défilante des formations */
.ticker { background: var(--gold-light); color: var(--navy-dark); overflow: hidden; white-space: nowrap; padding: 14px 0; font-weight: 700; letter-spacing: .02em; }
.ticker-track { display: inline-flex; gap: 42px; padding-left: 42px; animation: ticker 32s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span::before { content: "✦"; margin-right: 42px; color: var(--red); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Réseaux sociaux (pied de page) */
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #fff; transition: background .2s, transform .2s; }
.socials a:hover { background: var(--gold-light); color: var(--navy-dark); transform: translateY(-3px); }

/* Atouts numériques */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .3s, box-shadow .3s, border-color .3s; }
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--teal); }
.feature .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 16px; background: linear-gradient(135deg, rgba(26,153,165,.15), rgba(241,199,91,.25)); }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .93rem; }
.feature a { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--teal); font-size: .9rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } .to-top { bottom: 90px; } }

@media (prefers-reduced-motion: reduce) {
  .hero-deco, .scroll-progress { display: none; }
  .ticker-track { animation: none; }
  .card::after, .quick a::after { display: none; }
}
.socials-dark a { background: var(--offwhite); color: var(--heading); }
.info-list b a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
