:root {
  --blue: #0d4fc0;
  --blue-dark: #0a3d96;
  --blue-50: #eaf1fd;
  --blue-100: #d6e4fb;
  --navy: #0b2a5e;
  --green: #129a4a;
  --green-dark: #0d7a3a;
  --green-50: #e6f6ec;
  --red: #d32f2f;
  --red-50: #fdecec;
  --amber: #b26a00;
  --amber-50: #fff4e0;
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --ink-3: #7a879c;
  --line: #e2e8f0;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 14px rgba(15, 27, 45, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid transparent; border-radius: 8px; padding: .7rem 1.25rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--green-dark); }
.btn-outline { background: #fff; border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue-50); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: .4rem .8rem; min-height: 34px; font-size: .875rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; font-size: .85rem; text-decoration: underline; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- En-tête public ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand img { width: 42px; height: 42px; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .02em; }
.brand small { display: block; font-size: .7rem; color: var(--ink-2); max-width: 210px; line-height: 1.25; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.topnav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .92rem; }
.topnav a:not(.btn):hover { color: var(--blue); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .45rem; cursor: pointer; }

/* ---------- Accueil ---------- */
.hero { position: relative; overflow: hidden; color: var(--ink); background: linear-gradient(90deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.9) 38%, rgba(255,255,255,.15) 70%), url("/img/hero.svg") center right / cover no-repeat; }
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 4.5rem 1rem 5rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); color: var(--navy); letter-spacing: .02em; margin-bottom: .3rem; }
.hero .lead { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 600; color: var(--navy); max-width: 560px; }
.hero p { max-width: 520px; color: var(--ink-2); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-actions .btn { padding: .9rem 1.4rem; font-size: 1rem; }
.features { max-width: 1200px; margin: -2.5rem auto 0; padding: 0 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; position: relative; }
.feature { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.25rem; text-align: center; text-decoration: none; color: var(--ink); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,27,45,.1); }
.feature .ficon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .75rem; background: var(--blue-50); color: var(--blue); }
.feature h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.section { max-width: 1200px; margin: 0 auto; padding: 3.5rem 1rem 0; }
.section h2 { font-size: 1.6rem; color: var(--navy); }
.steps-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: g; margin-top: 1.25rem; }
.steps-guide li { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; counter-increment: g; }
.steps-guide li::before { content: counter(g); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; margin-bottom: .6rem; }
.steps-guide strong { display: block; margin-bottom: .25rem; }
.steps-guide span { color: var(--ink-2); font-size: .9rem; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: .6rem; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--ink-2); margin: .6rem 0 0; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.contact-grid div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.site-footer { margin-top: 4rem; background: var(--navy); color: #c8d5ee; text-align: center; padding: 1.5rem 1rem; font-size: .85rem; }
.site-footer a { color: #fff; }

/* ---------- Parcours (wizard) ---------- */
.wizard-page { max-width: 760px; margin: 2rem auto; padding: 0 1rem; }
.panel { background: #fff; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 2rem; }
.panel-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; }
.panel-head img { width: 34px; height: 34px; }
.panel-head strong { font-size: 1.15rem; }
.stepper { display: flex; justify-content: space-between; position: relative; margin: 0 0 2rem; padding: 0; list-style: none; }
.stepper::before { content: ""; position: absolute; top: 15px; left: 12%; right: 12%; height: 2px; background: var(--line); }
.stepper li { flex: 1; text-align: center; position: relative; font-size: .78rem; color: var(--ink-3); }
.stepper .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .35rem; background: #fff; border: 2px solid #cbd5e1; font-weight: 700; color: var(--ink-2); position: relative; }
.stepper li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.stepper li.active .dot { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-100); }
.stepper li.active { color: var(--blue); font-weight: 600; }
.stepper li.done { color: var(--ink-2); }
.wizard-title { font-size: 1.3rem; margin-bottom: .3rem; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.center { text-align: center; }
.avatar-ico { width: 84px; height: 84px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; margin: 0 auto 1rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label, .label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.req { color: var(--red); }
.input, select.input, textarea.input { width: 100%; border: 1px solid #cfd8e3; border-radius: 8px; padding: .7rem .85rem; background: #fff; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.input[readonly] { background: #f1f5f9; color: var(--ink-2); }
textarea.input { min-height: 120px; resize: vertical; }
.input.invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: .82rem; margin-top: .3rem; }
.hint { color: var(--ink-3); font-size: .8rem; margin-top: .3rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.section-label { font-weight: 700; font-size: .95rem; margin: 1.4rem 0 .6rem; color: var(--navy); }
.wizard-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.wizard-actions .btn { min-width: 140px; }
.secure-note { display: flex; align-items: center; gap: .4rem; color: var(--ink-3); font-size: .8rem; margin-top: 1.5rem; justify-content: center; }
.alert { border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem; font-size: .92rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert-error { background: var(--red-50); color: #8d1c1c; border: 1px solid #f5c2c2; }
.alert-info { background: var(--blue-50); color: var(--blue-dark); border: 1px solid var(--blue-100); }
.alert-success { background: var(--green-50); color: #0b5e2e; border: 1px solid #b7e4c7; }
.help-pop { background: var(--blue-50); border-radius: 8px; padding: .8rem 1rem; font-size: .85rem; color: var(--ink-2); margin-top: .5rem; }

.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.type-card { position: relative; display: block; border: 2px solid var(--line); border-radius: 12px; padding: 1.5rem 1.2rem; text-align: center; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.type-card input { position: absolute; opacity: 0; }
.type-card .ticon { color: var(--blue); margin-bottom: .6rem; }
.type-card h3 { color: var(--blue); font-size: 1.05rem; }
.type-card p { color: var(--ink-2); font-size: .85rem; margin: 0 0 1rem; }
.type-card .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #94a3b8; margin: 0 auto; display: grid; place-items: center; }
.type-card:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.type-card:has(input:checked) .radio { border-color: var(--blue); }
.type-card:has(input:checked) .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.type-card:has(input:focus-visible) { outline: 3px solid #7fb0ff; }
.type-card.disabled { opacity: .55; cursor: not-allowed; }

.readonly-box { background: #f1f5f9; border-radius: 8px; padding: .65rem .85rem; color: var(--ink-2); margin-bottom: .6rem; }
.readonly-box small { display: block; color: var(--ink-3); font-size: .75rem; }

.piece { display: flex; align-items: center; gap: .9rem; border: 1px solid var(--line); border-radius: 10px; padding: .85rem 1rem; margin-bottom: .7rem; }
.piece .pico { width: 40px; height: 40px; border-radius: 8px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; flex: none; }
.piece .pinfo { flex: 1; min-width: 0; }
.piece .pinfo strong { display: block; font-size: .92rem; font-weight: 500; }
.piece .pinfo .fname { font-size: .8rem; color: var(--green-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece.has-file { border-color: #9fd8b4; background: #f6fcf8; }
.piece input[type=file] { display: none; }

.recap-block { border-bottom: 1px solid var(--line); padding: .9rem 0; display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.recap-block:last-of-type { border-bottom: 0; }
.recap-block h4 { margin: 0 0 .35rem; font-size: .9rem; }
.recap-block p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.recap-files { margin: 0; padding: 0; list-style: none; }
.recap-files li { display: flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--ink-2); }
.check-row { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem; font-size: .9rem; }
.check-row input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--blue); }

.success-ico { width: 84px; height: 84px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; margin: 0 auto 1rem; }
.ref-box { display: inline-block; font-size: 1.4rem; font-weight: 700; letter-spacing: .04em; background: var(--blue-50); color: var(--blue-dark); padding: .5rem 1.2rem; border-radius: 8px; margin: .5rem 0 1rem; }

/* ---------- Espace candidat ---------- */
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 1.25rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { margin-bottom: 1.75rem; padding: 0 .4rem; }
.sidebar .brand small { font-size: .82rem; }
.sidenav { display: flex; flex-direction: column; gap: .25rem; }
.sidenav a, .sidenav button { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .93rem; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.sidenav a:hover, .sidenav button:hover { background: #f1f5f9; }
.sidenav a.active { background: var(--blue); color: #fff; }
.sidenav .badge-count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }
.sidenav-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 1rem; }
.main { padding: 2rem 2.25rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.page-head p { margin: 0; color: var(--ink-2); }
.mobile-bar { display: none; }

.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { background: none; border: 1px solid transparent; border-bottom: 0; padding: .6rem 1.1rem; cursor: pointer; border-radius: 8px 8px 0 0; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-color: var(--line); background: #fff; margin-bottom: -1px; font-weight: 600; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.dcard { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 1.1rem; align-items: start; }
.dcard .dicon { width: 56px; height: 56px; color: var(--blue); display: grid; place-items: center; background: var(--blue-50); border-radius: 12px; }
.dcard-top { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.dcard-top h3 { margin: 0; font-size: 1.15rem; }
.dcard .date { color: var(--ink-2); font-size: .88rem; margin: .15rem 0 .9rem; }
.dcard-body { display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: center; }
.route { display: grid; grid-template-columns: 1fr 24px 1fr; gap: .5rem; align-items: center; font-size: .92rem; }
.route strong { display: block; font-weight: 600; }
.route span { color: var(--ink-2); font-size: .85rem; }
.route .arrow { color: var(--ink-3); }
.dcard-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1rem; }
.tag { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 600; padding: .25rem .6rem; border-radius: 6px; }
.tag-reo { background: var(--blue); color: #fff; }
.tag-ori { background: var(--green); color: #fff; }
.status { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 600; padding: .35rem .8rem; border-radius: 6px; white-space: nowrap; }
.status-soumise { background: #eef2f7; color: var(--ink-2); }
.status-en_instruction { background: var(--blue-50); color: var(--blue-dark); }
.status-en_commission { background: var(--amber-50); color: var(--amber); }
.status-acceptee { background: var(--green-50); color: var(--green-dark); }
.status-rejetee { background: var(--red-50); color: var(--red); }

.track { display: flex; list-style: none; padding: 0; margin: 0; min-width: 330px; }
.track li { flex: 1; text-align: center; font-size: .72rem; color: var(--ink-3); position: relative; padding-top: 26px; line-height: 1.25; }
.track li::before { content: ""; position: absolute; top: 9px; left: 50%; width: 100%; height: 2px; background: #d5dce6; }
.track li:last-child::before { display: none; }
.track li .tdot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: #d5dce6; display: grid; place-items: center; z-index: 1; }
.track li.done::before { background: var(--green); }
.track li.done .tdot { background: var(--green); color: #fff; }
.track li.current .tdot { background: #fff; border: 2px solid var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.track li.current .tdot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.track li.current { color: var(--ink); font-weight: 600; }
.track li.done { color: var(--ink-2); }
.track time { display: block; color: var(--ink-3); font-weight: 400; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.4rem 2.4rem; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: #d5dce6; }
.timeline li:last-child::before { display: none; }
.timeline .tdot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: #d5dce6; display: grid; place-items: center; color: #fff; }
.timeline li.done .tdot { background: var(--green); }
.timeline li.done::before { background: var(--green); }
.timeline li.current .tdot { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-100); }
.timeline strong { display: block; font-size: .95rem; }
.timeline li:not(.done):not(.current) strong { color: var(--ink-3); font-weight: 500; }
.timeline small { color: var(--ink-3); }
.timeline p { margin: .2rem 0 0; font-size: .88rem; color: var(--ink-2); }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: .55rem 1rem; font-size: .92rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.file-list li:last-child { border-bottom: 0; }
.file-list a { text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .file-list li { flex-wrap: wrap; } .file-list li > .muted { order: 3; flex-basis: 100%; padding-left: 1.85rem; } }
.file-list small { color: var(--ink-3); margin-left: auto; }
.decision-box { border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.decision-box.ok { background: var(--green-50); border: 1px solid #b7e4c7; }
.decision-box.ko { background: var(--red-50); border: 1px solid #f5c2c2; }

.notif { display: flex; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif .nicon { width: 38px; height: 38px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; flex: none; }
.notif.unread .nicon { background: var(--blue); color: #fff; }
.notif p { margin: 0; font-size: .92rem; }
.notif small { color: var(--ink-3); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); }
.empty .icon { width: 48px; height: 48px; color: var(--ink-3); }
.empty .btn .icon { width: 1.25em; height: 1.25em; color: inherit; }

.loader { display: grid; place-items: center; padding: 4rem; color: var(--ink-3); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .75rem 1.2rem; border-radius: 8px; z-index: 100; box-shadow: var(--shadow); font-size: .92rem; max-width: calc(100% - 2rem); }

/* ---------- Tableau (agent) ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); padding: .7rem .6rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #f8fafc; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters .input { width: auto; min-width: 180px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; }
.stat strong { display: block; font-size: 1.8rem; color: var(--navy); }
.stat span { color: var(--ink-2); font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .dcard-body { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
  .dcard { grid-template-columns: 56px minmax(0, 1fr); }
  .dcard-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .steps-guide { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .app-shell.nav-open .sidebar { transform: none; }
  .app-shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,27,45,.4); z-index: 40; }
  .mobile-bar { display: flex; align-items: center; gap: .75rem; background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1rem; position: sticky; top: 0; z-index: 30; }
  .mobile-bar button { background: none; border: 1px solid var(--line); border-radius: 8px; padding: .4rem; cursor: pointer; }
  .mobile-bar img { width: 30px; height: 30px; }
  .main { padding: 1.25rem 1rem; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .menu-toggle { display: inline-flex; }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 1rem; gap: .25rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .topnav.open { display: flex; }
  .topnav a:not(.btn) { padding: .6rem .4rem; }
  .topbar-inner { position: relative; }
  .brand small { display: none; }
  .hero { background: linear-gradient(180deg, rgba(11,42,94,.35) 0%, rgba(11,42,94,.85) 100%), url("/img/hero.svg") center / cover no-repeat; color: #fff; text-align: center; }
  .hero-inner { padding: 3rem 1rem 4.5rem; }
  .hero h1, .hero .lead { color: #fff; margin-left: auto; margin-right: auto; }
  .hero p { color: #e6edf9; margin-left: auto; margin-right: auto; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .btn-outline { background: #fff; }
  .features { grid-template-columns: 1fr; margin-top: -2rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .steps-guide { grid-template-columns: 1fr; }
  .wizard-page { margin: 0; padding: 0; }
  .panel { border-radius: 0; border: 0; box-shadow: none; padding: 1.25rem 1rem 2rem; min-height: calc(100vh - 62px); }
  .type-cards, .grid-2 { grid-template-columns: 1fr; }
  .type-card { display: grid; grid-template-columns: 48px 1fr 24px; text-align: left; gap: .25rem .9rem; align-items: center; padding: 1rem; }
  .type-card .ticon { grid-row: span 2; margin: 0; }
  .type-card h3 { margin: 0; }
  .type-card p { margin: 0; grid-column: 2; }
  .type-card .radio { grid-row: 1 / span 2; grid-column: 3; }
  .wizard-actions { flex-direction: column-reverse; }
  .wizard-actions .btn { width: 100%; }
  .stepper li span.lbl { display: none; }
  .stepper li.active span.lbl { display: block; }
  .dcard { grid-template-columns: 1fr; }
  .dcard .dicon { display: none; }
  .route { grid-template-columns: 1fr; }
  .route .arrow { transform: rotate(90deg); justify-self: start; }
  .track { min-width: 0; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .6rem; }
  .recap-block { flex-direction: column; gap: .3rem; }
  .filters .input { width: 100%; }
}
@media print {
  .sidebar, .mobile-bar, .topbar, .btn { display: none !important; }
  .app-shell { display: block; }
}

/* Logo du ministère : pastille blanche pour rester lisible sur fond foncé */
.brand img, .mobile-bar img { object-fit: contain; }
.topbar .brand img, .sidebar .brand img, .mobile-bar img { background: #fff; border-radius: 50%; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.topbar .brand img, .sidebar .brand img { width: 48px; height: 48px; }
.topbar .brand img.brand-logo { width: auto; height: 62px; background: none; box-shadow: none; border-radius: 0; padding: 0; }

/* =====================================================================
   THÈME COLORÉ — blocs en couleur
   ===================================================================== */
.c-blue   { --c: #1d5fe0; --c2: #4f8bff; --ct: #e8f0ff; --cd: #123f9e; }
.c-green  { --c: #0f9d58; --c2: #34c77b; --ct: #e4f7ec; --cd: #0a6b3c; }
.c-orange { --c: #f07d10; --c2: #ffab45; --ct: #fff1e2; --cd: #a85300; }
.c-violet { --c: #7c3aed; --c2: #a274ff; --ct: #f1eaff; --cd: #5521b5; }

body { background: linear-gradient(180deg, #eef3fc 0%, #f6f4fd 100%) fixed; }

/* En-tête */
.topbar { background: linear-gradient(90deg, #0b2a5e 0%, #1d5fe0 100%); border-bottom: 0; }
.topbar .brand, .topbar .topnav a:not(.btn) { color: #fff; }
.topbar .brand small { color: #c9d8f5; }
.topbar .topnav a:not(.btn):hover { color: #ffd166; }
.topbar .btn-primary { background: #ffd166; color: #0b2a5e; }
.topbar .btn-primary:hover:not(:disabled) { background: #ffc233; }
.menu-toggle { color: #fff; border-color: rgba(255,255,255,.4); }

/* Héros */
.hero { color: #fff; background: linear-gradient(110deg, #0b2a5e 0%, #1d5fe0 60%, #3b1f8f 100%); }
/* Photo d'étudiants à droite, fondue dans le dégradé côté gauche */
.hero::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 58%; background: url("/img/hero-etudiants.webp") center 25% / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%); mask-image: linear-gradient(90deg, transparent 0%, #000 30%); }
.hero-inner { position: relative; z-index: 1; }
.hero .hero-inner > * { max-width: min(520px, 46vw); }
@media (max-width: 720px) { .hero .hero-inner > * { max-width: none; } }
.hero h1 { color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,.25); }
.hero .lead { color: #ffd166; }
.hero p { color: #dbe6fb; }
.hero-actions .btn-success { background: linear-gradient(135deg, #0f9d58, #34c77b); box-shadow: 0 6px 18px rgba(15,157,88,.35); }
.hero-actions .btn-outline { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.6); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.22); }

/* Cartes d'accueil colorées */
.feature[class*="c-"] { background: linear-gradient(140deg, var(--c) 0%, var(--c2) 100%); color: #fff; border: 0; box-shadow: 0 10px 26px rgba(15,27,45,.15); }
.feature[class*="c-"] p { color: rgba(255,255,255,.9); }
.feature[class*="c-"] .ficon { background: rgba(255,255,255,.22); color: #fff; }

/* Guide : chaque étape a sa couleur */
.steps-guide li { border: 0; border-top: 5px solid var(--sc); background: linear-gradient(180deg, var(--st) 0%, #fff 70%); box-shadow: var(--shadow); }
.steps-guide li::before { background: var(--sc); }
.steps-guide li:nth-child(1) { --sc: #1d5fe0; --st: #e8f0ff; }
.steps-guide li:nth-child(2) { --sc: #0f9d58; --st: #e4f7ec; }
.steps-guide li:nth-child(3) { --sc: #f07d10; --st: #fff1e2; }
.steps-guide li:nth-child(4) { --sc: #7c3aed; --st: #f1eaff; }

/* FAQ */
.faq details { border: 0; border-left: 5px solid #1d5fe0; box-shadow: var(--shadow); }
.faq details:nth-of-type(2) { border-left-color: #0f9d58; }
.faq details:nth-of-type(3) { border-left-color: #f07d10; }
.faq details:nth-of-type(4) { border-left-color: #7c3aed; }
.faq details:nth-of-type(5) { border-left-color: #db2777; }
.faq details[open] summary { color: #1d5fe0; }

/* Contact */
.contact-grid div[class*="c-"] { background: var(--ct); border: 0; border-top: 5px solid var(--c); }
.contact-grid div[class*="c-"] strong { color: var(--cd); }
.site-footer { background: linear-gradient(90deg, #0b2a5e, #3b1f8f); }

/* Parcours de demande */
.panel { border: 0; overflow: hidden; position: relative; }
.panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: linear-gradient(90deg, #1d5fe0, #0f9d58, #f07d10, #7c3aed); }
.stepper li.done .dot { background: #0f9d58; border-color: #0f9d58; }
.stepper li.active .dot { background: linear-gradient(135deg, #1d5fe0, #7c3aed); border-color: #1d5fe0; }
.avatar-ico { background: linear-gradient(135deg, #1d5fe0, #7c3aed); color: #fff; }
.type-card[class*="c-"] { border-color: var(--ct); background: linear-gradient(180deg, var(--ct), #fff); }
.type-card[class*="c-"] .ticon { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto .8rem; display: grid; place-items: center; background: var(--c); color: #fff; }
.type-card[class*="c-"] h3 { color: var(--cd); }
.type-card[class*="c-"]:has(input:checked) { border-color: var(--c); background: var(--ct); box-shadow: 0 8px 22px rgba(15,27,45,.12); }
.type-card[class*="c-"]:has(input:checked) .radio { border-color: var(--c); }
.type-card[class*="c-"]:has(input:checked) .radio::after { background: var(--c); }
.readonly-box { background: #eef3fc; border-left: 4px solid #1d5fe0; }
.piece { border: 0; box-shadow: 0 1px 4px rgba(15,27,45,.1); background: #fff; }
.piece:nth-child(1) .pico { background: #e8f0ff; color: #1d5fe0; }
.piece:nth-child(2) .pico { background: #e4f7ec; color: #0f9d58; }
.piece:nth-child(3) .pico { background: #fff1e2; color: #f07d10; }
.piece:nth-child(4) .pico { background: #f1eaff; color: #7c3aed; }
.piece.has-file { background: #f2fbf6; box-shadow: inset 4px 0 0 #0f9d58, 0 1px 4px rgba(15,27,45,.1); }
.recap-block { border-bottom: 0; background: #f7f9fe; border-radius: 10px; padding: .9rem 1rem; margin-bottom: .6rem; border-left: 4px solid #1d5fe0; }
.recap-block:nth-of-type(even) { border-left-color: #0f9d58; background: #f4fbf7; }
.success-ico { background: linear-gradient(135deg, #0f9d58, #34c77b); color: #fff; }
.ref-box { background: linear-gradient(135deg, #1d5fe0, #7c3aed); color: #fff; }

/* Espace candidat */
.sidebar { background: linear-gradient(180deg, #0b2a5e 0%, #1b3f8f 60%, #3b1f8f 100%); border-right: 0; color: #fff; }
.sidebar .brand { color: #fff; }
.sidebar .brand small { color: #ffd166; }
.sidenav a, .sidenav button { color: #dbe6fb; }
.sidenav a:hover, .sidenav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidenav a.active { background: #fff; color: #0b2a5e; font-weight: 600; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.sidenav-bottom { border-top-color: rgba(255,255,255,.15); }
.mobile-bar { background: linear-gradient(90deg, #0b2a5e, #1d5fe0); color: #fff; border-bottom: 0; }
.mobile-bar button { color: #fff; border-color: rgba(255,255,255,.4); }
.mobile-bar a { color: #fff !important; }
.page-head h1 { background: linear-gradient(90deg, #0b2a5e, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tile { border-radius: 14px; padding: 1rem 1.1rem; color: #fff; background: linear-gradient(140deg, var(--c), var(--c2)); box-shadow: 0 8px 20px rgba(15,27,45,.12); min-width: 0; }
.tile span { display: flex; align-items: center; gap: .4rem; font-size: .8rem; opacity: .9; margin-bottom: .35rem; }
.tile strong { display: block; font-size: 1rem; overflow-wrap: anywhere; }

.tabs { border-bottom: 0; gap: .5rem; }
.tabs button { border-radius: 999px; border: 1px solid #d5dce6; background: #fff; padding: .45rem 1rem; }
.tabs button.active { background: linear-gradient(135deg, #1d5fe0, #7c3aed); color: #fff; border-color: transparent; margin: 0; }

.card { border: 0; }
.dcard { border-left: 6px solid #1d5fe0; }
.dcard .dicon { background: #e8f0ff; color: #1d5fe0; }
.dcard.is-ori { border-left-color: #0f9d58; }
.dcard.is-ori .dicon { background: #e4f7ec; color: #0f9d58; }
.card h2 { display: flex; align-items: center; gap: .5rem; }
.card h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: linear-gradient(180deg, #1d5fe0, #7c3aed); flex: none; }
.detail-grid > .card h2::before, .detail-grid > div + div .card h2::before { background: linear-gradient(180deg, #0f9d58, #34c77b); }
.tag-reo { background: linear-gradient(135deg, #1d5fe0, #4f8bff); }
.tag-ori { background: linear-gradient(135deg, #0f9d58, #34c77b); }
.status-en_commission { background: #fff1e2; color: #a85300; }
.status-en_instruction { background: #f1eaff; color: #5521b5; }
.track li.current .tdot { border-color: #7c3aed; box-shadow: 0 0 0 3px #e6dbff; }
.track li.current .tdot::after { background: #7c3aed; }
.timeline li.current .tdot { background: #7c3aed; box-shadow: 0 0 0 4px #e6dbff; }
.notif:nth-child(4n+1) .nicon { background: #e8f0ff; color: #1d5fe0; }
.notif:nth-child(4n+2) .nicon { background: #e4f7ec; color: #0f9d58; }
.notif:nth-child(4n+3) .nicon { background: #fff1e2; color: #f07d10; }
.notif:nth-child(4n+4) .nicon { background: #f1eaff; color: #7c3aed; }
.notif.unread { background: #f7f9fe; border-radius: 10px; padding-left: .6rem; }

/* Back-office */
.stat[class*="c-"] { background: linear-gradient(140deg, var(--c), var(--c2)); border: 0; color: #fff; box-shadow: 0 8px 20px rgba(15,27,45,.12); }
.stat[class*="c-"] strong, .stat[class*="c-"] span { color: #fff; }
table.data th { background: #0b2a5e; color: #fff; border-bottom: 0; }
table.data tr:nth-child(even) td { background: #f7f9fe; }

@media (max-width: 960px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .tiles { grid-template-columns: 1fr; }
  .topnav { background: #0b2a5e; }
  .hero { background: linear-gradient(180deg, #0b2a5e 0%, #3b1f8f 100%); }
  .hero::after { width: 100%; opacity: .3; -webkit-mask-image: none; mask-image: none; }
  .hero-inner > * { margin-left: auto; margin-right: auto; }
  .type-card[class*="c-"] .ticon { width: 48px; height: 48px; margin: 0; }
}
