:root {
  --mauve: #5c2d91; --mauve-d: #47206f; --mauve-l: #efe8f7;
  --rose: #ee2e5d; --bleu: #00bcee; --vert: #1a9e6a; --orange: #e98b12;
  --txt: #1f1a27; --mut: #6f6880; --line: #e6e1ee; --bg: #f6f4fa; --card: #fff;
  --r: 12px; --sh: 0 1px 2px rgba(40,20,70,.06), 0 6px 24px rgba(40,20,70,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "PT Sans Caption", "Helvetica Neue", Arial, sans-serif; color: var(--txt); background: var(--bg); }
a { color: var(--mauve); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--mut); } .small { font-size: .85rem; }

/* Header */
.top { background: linear-gradient(140deg, var(--mauve) 50%, var(--rose) 100%); color: #fff; }
.top .in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 18px; }
.logo { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.logo span { font-weight: 400; opacity: .8; }
.top nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.top nav a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .9rem; opacity: .9; }
.top nav a:hover, .top nav a.on { background: rgba(255,255,255,.18); opacity: 1; }
.who { font-size: .85rem; opacity: .9; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.3); }

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); }

/* Buttons */
.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; border-radius: 999px; padding: 9px 18px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn-p { background: var(--mauve); color: #fff; } .btn-p:hover { background: var(--mauve-d); }
.btn-g { background: transparent; color: var(--mauve); box-shadow: inset 0 0 0 1.5px var(--mauve); } .btn-g:hover { background: var(--mauve-l); }
.btn-l { background: none; color: var(--mut); padding: 6px 10px; font-weight: 400; } .btn-l:hover { color: var(--mauve); }
.btn-sm { padding: 6px 14px; font-size: .88rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Attente : roue sur le bouton qui a lancé l'action, liste grisée pendant le rechargement */
.btn.is-busy, .btn.is-busy:disabled { opacity: .85; cursor: progress; }
.btn.is-busy::before, .spin { content: ""; display: inline-block; width: 1em; height: 1em; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; vertical-align: -.15em; }
.spin { margin-right: 8px; color: var(--mauve); }
.btn.is-busy .ico { display: none; }
.grid tbody { transition: opacity .15s; }
.grid.is-loading tbody { opacity: .45; pointer-events: none; }
.modal .m-err { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: #fdecf0; color: #b3123a; font-size: .9rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Manager */
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .grow { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 16px 18px; cursor: pointer; border: 2px solid transparent; transition: .15s; }
.kpi:hover { border-color: var(--mauve-l); } .kpi.on { border-color: var(--mauve); }
.kpi b { display: block; font-size: 1.7rem; line-height: 1.1; }
.kpi span { color: var(--mut); font-size: .88rem; }
.kpi .bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 10px; overflow: hidden; }
.kpi .bar i { display: block; height: 100%; background: var(--mauve); }

.toolbar { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; }
.search input:focus { outline: none; border-color: var(--mauve); }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--mut); font-size: 1.1rem; }
.bulk { display: none; align-items: center; gap: 10px; background: var(--mauve-l); padding: 6px 6px 6px 14px; border-radius: 999px; }
.bulk.show { display: flex; }

table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--mut); font-weight: 700; padding: 10px 16px; background: #fbfafd; border-bottom: 1px solid var(--line); }
.grid td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: #fcfbfe; }
.grid tbody tr.flash td { animation: flash 3s ease-out; } @keyframes flash { 0%, 40% { background: var(--mauve-l); } }
.grid .ck { width: 42px; } .grid .act { text-align: right; width: 1%; white-space: nowrap; }
.grid input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--mauve); cursor: pointer; }
.person { display: flex; align-items: center; gap: 12px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--mauve-l); color: var(--mauve); font-weight: 700; display: grid; place-items: center; font-size: .85rem; flex: none; }
.mono { font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-eligible { background: #eef0f4; color: #5d6577; }
.st-invited { background: #fff3e2; color: var(--orange); }
.st-done { background: #e3f6ee; color: var(--vert); }
.sub { display: block; font-size: .78rem; color: var(--mut); margin-top: 2px; }
.empty { padding: 40px; text-align: center; color: var(--mut); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(25,12,45,.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal.show { display: flex; animation: fade .15s; }
.modal .box { background: #fff; border-radius: 16px; width: 100%; max-width: 480px; padding: 26px; box-shadow: 0 20px 60px rgba(25,12,45,.3); animation: pop .18s; }
.modal .list { max-height: 180px; overflow: auto; margin: 14px 0; padding: 10px 14px; background: var(--bg); border-radius: 10px; font-size: .9rem; }
.modal .list div { padding: 3px 0; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.note { font-size: .85rem; padding: 10px 12px; border-radius: 8px; background: #eaf8fd; color: #04607b; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* Toasts */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: #241a33; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--sh); max-width: 380px; font-size: .9rem; transition: .35s; }
.toast a { color: #c9b3ee; font-weight: 700; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Employee page */
.hero { background: linear-gradient(140deg, var(--mauve) 50%, var(--rose) 100%); color: #fff; padding: 26px 24px 74px; }
.hero .in { max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 1.7rem; } .hero p { opacity: .92; margin: 0; max-width: 640px; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #e3f6ee; color: var(--vert); font-weight: 700; }

.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.choices.c2 { grid-template-columns: repeat(2, 1fr); }
.choice { position: relative; border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: .15s; display: block; }
.choice:hover { border-color: #cbbbe3; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--mauve); background: #faf7fe; box-shadow: 0 0 0 3px var(--mauve-l); }
.choice:has(input:checked)::after { content: "✓"; position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--mauve); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.choice .t { font-weight: 700; display: block; padding-right: 26px; }
.choice .d { display: block; font-size: .83rem; color: var(--mut); }
.choice .d.cond { margin-top: 2px; font-weight: 600; color: var(--txt); }
.choice .p { display: block; margin-top: 8px; font-size: 1.25rem; font-weight: 700; color: var(--mauve); }
.choice .p s { font-size: .8rem; color: var(--mut); font-weight: 400; margin-left: 4px; }
.choice .p small { font-size: .78rem; font-weight: 400; color: var(--mut); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .88rem; }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--mauve); background: var(--mauve); color: #fff; }

.fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; margin-top: 12px; }
.f { display: flex; flex-direction: column; gap: 4px; grid-column: span 6; }
.f.s3 { grid-column: span 3; } .f.s2 { grid-column: span 2; } .f.s4 { grid-column: span 4; } .f.s1 { grid-column: span 1; }
.f label { font-size: .82rem; color: var(--mut); font-weight: 700; }
.f input, .f select { width: 100%; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.f input:focus, .f select:focus { outline: none; border-color: var(--mauve); }
.f input[readonly] { background: var(--bg); color: var(--mut); cursor: default; }
.f input[readonly]:focus { border-color: var(--line); }
.f.err input, .f.err select { border-color: var(--rose); }
.f .hint { font-size: .78rem; color: var(--mut); }
.reveal { display: none; } .reveal.show { display: block; animation: fade .2s; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--mauve); margin-top: 2px; flex: none; }
.check.err { color: var(--rose); }
details.legal { margin-top: 10px; font-size: .85rem; color: var(--mut); }
details.legal summary { cursor: pointer; color: var(--mauve); font-weight: 700; }
details.legal ul { padding-left: 18px; }
.drop { border: 1.5px dashed #cbbbe3; border-radius: 10px; padding: 12px 14px; font-size: .88rem; color: var(--mut); cursor: pointer; display: block; }
.drop input { display: none; }
.drop.has { border-style: solid; border-color: var(--vert); color: var(--vert); }
.f.err .drop { border-color: var(--rose); }


.done .ic { width: 64px; height: 64px; border-radius: 50%; background: #e3f6ee; color: var(--vert); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 16px; }

/* Mailbox */
.mb { display: grid; grid-template-columns: 340px 1fr; gap: 18px; min-height: 520px; }
.mb .lst { overflow: auto; max-height: 75vh; }
.mb .it { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mb .it:hover { background: #fcfbfe; } .mb .it.on { background: var(--mauve-l); }
.mb .it b { display: block; font-size: .9rem; }
.mb .view { padding: 0; overflow: hidden; }
.mb .meta { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.dl { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.dl-sent { background: #e3f6ee; color: var(--vert); } .dl-demo { background: #eef0f4; color: #5d6577; } .dl-error { background: #fde6ec; color: var(--rose); }

@media (max-width: 880px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .choices { grid-template-columns: 1fr; }
  .grid .hide-m { display: none; }
  .f.s3, .f.s2, .f.s4, .f.s1 { grid-column: span 6; }
}

/* ---------- Assistant collaborateur ---------- */
.wiz { max-width: 640px; margin: -50px auto 60px; overflow: hidden; }
.wiz-top { padding: 20px 32px 0; }
.progress { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--mauve), var(--rose)); transition: width .45s cubic-bezier(.2,0,0,1); }
.wiz-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: .82rem; color: var(--mut); min-height: 1.3em; }
.wiz-meta b { color: var(--mauve); font-size: .95rem; }
.stage { padding: 14px 32px 6px; overflow: hidden; }
.step:focus-within h2:focus { outline: none; }
.step h2 { font-size: 1.5rem; margin-bottom: 6px; outline: none; }
.eyebrow { margin: 6px 0 6px; font-size: .75rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--rose); }
.lead { margin: 0 0 4px; color: var(--mut); }
.hint-l { font-size: .85rem; margin: 14px 0 0; }

.intro-id { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border-radius: 12px; margin-bottom: 22px; }
.intro-id .av { width: 42px; height: 42px; }
.intro-id .tag { margin-left: auto; }
.perks { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; }
.perks li::before { content: "✓"; width: 24px; height: 24px; border-radius: 50%; background: var(--mauve-l); color: var(--mauve); font-weight: 700; font-size: .8rem; display: grid; place-items: center; flex: none; }

.choices.stack { grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
.wiz .choice { display: flex; align-items: center; gap: 14px; padding: 15px 18px; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.wiz .choice:hover { transform: translateY(-1px); }
.wiz .choice::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cfc6dd; flex: none; transition: .15s; }
.wiz .choice:has(input:checked)::before { border-color: var(--mauve); background: var(--mauve); box-shadow: inset 0 0 0 4px #fff; }
.wiz .choice:has(input:checked)::after { content: none; }
.wiz .choice:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--mauve-l); }
.wiz .choice .ct { flex: 1; min-width: 0; }
.wiz .choice .t { padding: 0; }
.wiz .choice .p { margin: 0; text-align: right; white-space: nowrap; font-size: 1.1rem; }
.wiz .choice .p s { display: block; margin: 0; }
.wiz .choice .p small { font-size: .82rem; }
.wiz .reveal { margin-top: 16px; }

.recap { margin: 16px 0 8px; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.recap .row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: baseline; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.recap .row:last-child { border-bottom: 0; }
.recap .k { color: var(--mut); }
.recap .v { font-weight: 700; }
.recap .edit { border: 0; background: none; color: var(--mauve); cursor: pointer; font: inherit; font-size: .85rem; padding: 0; }
.recap .edit:hover { text-decoration: underline; }
.recap .total { background: #faf7fe; }
.recap .total .v { color: var(--mauve); font-size: 1.15rem; }

.wiz-nav { display: flex; align-items: center; gap: 12px; padding: 18px 32px 26px; }
.wiz-nav #next { margin-left: auto; padding: 12px 26px; }
.err-msg { color: var(--rose); font-size: .85rem; font-weight: 700; }

.done { padding: 36px; text-align: center; }
.done .recap { text-align: left; }
.done .recap .row { grid-template-columns: 120px 1fr; }

@media (max-width: 640px) {
  .wiz { margin: -50px 12px 40px; }
  .wiz-top, .stage { padding-left: 20px; padding-right: 20px; }
  .wiz-nav { padding: 16px 20px 22px; flex-wrap: wrap; }
  .err-msg { order: 3; width: 100%; }
  .step h2 { font-size: 1.3rem; }
  .recap .row { grid-template-columns: 1fr auto; }
  .recap .k { grid-column: 1 / -1; font-size: .8rem; }
  .intro-id .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { .progress i, .wiz .choice { transition: none; } .btn.is-busy::before, .spin { animation-duration: 1.6s; } }

/* ---------- Production : pages de compte, admin, divers ---------- */
.auth { max-width: 420px; margin: -50px auto 60px; padding: 30px 32px; }
.auth h2 { font-size: 1.35rem; }
.auth form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 16px; }
.auth form[hidden] { display: none; }
.auth .f { grid-column: auto; } /* .f s'étale sur 6 colonnes dans les grilles du formulaire bénéficiaire, pas ici */
.auth .check { margin-top: 0; }
.auth .f input { font-size: 1rem; }
.auth .btn-p { justify-content: center; padding: 12px; }
.auth .links { margin-top: 16px; font-size: .9rem; text-align: center; }
.msg { padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.msg.err { background: #fde6ec; color: #a3133a; } .msg.ok { background: #e3f6ee; color: #0c6b45; } .msg.info { background: #eaf8fd; color: #04607b; }
.msg:empty { display: none; }
.pw-rules { font-size: .8rem; color: var(--mut); margin: 0; padding-left: 18px; }
.fw-normal { font-weight: 400; }
.hidden { display: none !important; }
.ic.bad { background: #fde6ec; color: var(--rose); }
.st-requested { background: #e3f6ee; color: var(--vert); }
.st-other { background: #eef0f4; color: #5d6577; }
.st-warn { background: #fde6ec; color: var(--rose); }
.why { font-size: .78rem; color: var(--mut); }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .88rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; background: #fff; }
.lang { margin-left: auto; display: flex; gap: 4px; }
.lang button { border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 999px; padding: 2px 10px; cursor: pointer; font: inherit; font-size: .8rem; }
.lang button.on { background: #fff; color: var(--mauve); }
.hero .top-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section { margin-bottom: 22px; }
.section > h2 { margin: 0 0 10px; }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.result:last-child { border-bottom: 0; }
.result .grow { flex: 1; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 16px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: .88rem; }
.stats b { display: block; font-size: 1.3rem; }
.banner { background: #fff3e2; color: #8a4b00; text-align: center; font-size: .85rem; padding: 6px 12px; }
.legal-page { max-width: 760px; margin: -50px auto 60px; padding: 30px 36px; }
.legal-page h2 { margin-top: 1.4em; } .legal-page h2:first-child { margin-top: 0; }
.mail-item { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mail-item a { word-break: break-all; }
