/* ==========================================================================
   Plateforme Examen d'État - feuille de style
   ========================================================================== */
:root {
  --g950:#092719; --g900:#0a3d25; --g800:#0c5233; --g700:#0f6b3f; --g600:#14804a; --g500:#1a9a5a; --g100:#e3f4ea; --g50:#f3faf5;
  --red:#c8102e; --red-dark:#a30e27; --red-100:#fde8eb;
  --ink:#18251d; --ink2:#33443a; --muted:#64736a; --line:#dfe9e2; --bg:#f4f8f5; --card:#fff;
  --r:14px; --r-sm:10px;
  --shadow:0 2px 5px rgba(9,39,25,.04), 0 14px 35px -22px rgba(9,39,25,.28);
  --shadow-lg:0 22px 60px -28px rgba(9,39,25,.38);
  --ring:0 0 0 3px rgba(20,128,74,.2);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
::selection { color:#fff; background:var(--g700); }
button,input,select,textarea { accent-color:var(--g600); }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid rgba(20,128,74,.28); outline-offset:2px; }
body { margin:0; font-family:var(--font); color:var(--ink); background:radial-gradient(ellipse at 50% -30%, #fff 0, transparent 58%),var(--bg); line-height:1.55; font-size:15px; -webkit-font-smoothing:antialiased; }
img { max-width:100%; } svg { flex:none; }
a { color:var(--g700); text-decoration:none; } a:hover { text-decoration:underline; }
h1,h2,h3,p { margin:0; }
.container { width:min(1240px, 100% - 40px); margin-inline:auto; }
.container.narrow, main.narrow { width:min(560px, 100% - 40px); }
main.container { padding-block:26px 120px; }
.muted { color:var(--muted); } .tiny { font-size:12.5px; } .center { text-align:center; } .light { font-weight:500; color:var(--ink2); }
.h1 { font-size:28px; line-height:1.18; font-weight:780; letter-spacing:-.035em; color:var(--g950); }
.h2 { font-size:21px; font-weight:700; margin-bottom:14px; }
.h3 { font-size:16.5px; font-weight:700; }
.row { display:flex; align-items:center; gap:12px; } .row.end { justify-content:flex-end; } .row.gap { gap:8px; }

/* ---------- Barre supérieure ---------- */
.topbar { position:sticky; top:0; z-index:30; background:rgba(255,255,255,.96); backdrop-filter:saturate(1.2) blur(14px); border-bottom:1px solid var(--line); box-shadow:0 4px 18px -16px rgba(9,39,25,.35); }
.topbar::before { content:""; display:block; height:3px; background:linear-gradient(90deg,var(--g700) 0 48%,#fff 48% 52%,var(--red) 52% 100%); }
.topbar-in { width:min(1320px, 100% - 48px); margin-inline:auto; min-height:70px; display:flex; align-items:center; gap:24px; }
.brand { display:flex; align-items:center; gap:11px; color:var(--ink); } .brand:hover { text-decoration:none; }
.brand-txt { display:flex; flex-direction:column; line-height:1.15; } .brand-txt strong { font-size:16px; } .brand-txt small { color:var(--muted); font-size:12px; }
.nav { display:flex; gap:4px; margin-left:8px; flex:1; }
.nav a { padding:9px 15px; border-radius:10px; color:var(--ink2); font-weight:650; font-size:13.5px; transition:background .15s,color .15s; }
.nav a:hover { background:var(--g50); color:var(--g800); text-decoration:none; } .nav a.on { background:var(--g700); color:#fff; box-shadow:0 5px 14px -8px var(--g900); }
.who { display:flex; align-items:center; gap:11px; }
.who-txt { display:flex; flex-direction:column; line-height:1.15; text-align:right; } .who-txt strong { font-size:13.5px; } .who-txt small { color:var(--muted); font-size:11.5px; }
.avatar { width:40px; height:40px; border-radius:13px; background:linear-gradient(145deg,var(--g600),var(--g900)); color:#fff; display:grid; place-items:center; font-weight:750; font-size:13.5px; letter-spacing:.3px; flex:none; box-shadow:0 5px 12px -7px var(--g900); }
.avatar.xl { width:64px; height:64px; font-size:21px; box-shadow:0 8px 20px -8px rgba(15,107,63,.6); }
.brand img { border-radius:12px; }

/* ---------- Cartes & mise en page ---------- */
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); margin-bottom:22px; }
.card.pad { padding:22px; } .card-head { padding:18px 22px 6px; }
.notes-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:24px; flex-wrap:wrap; padding:4px 0 2px; }
.page-head p { margin-top:4px; }
.page-head .muted { max-width:760px; }
.grid-2 { display:grid; grid-template-columns:1.1fr 1fr; gap:20px; } .grid-2 > .card { margin-bottom:20px; }
.back { display:inline-flex; align-items:center; gap:7px; font-weight:600; margin-bottom:14px; color:var(--ink2); } .back:hover { color:var(--g700); text-decoration:none; }
.foot { padding:26px 0 38px; color:var(--muted); font-size:12.5px; text-align:center; border-top:1px solid var(--line); background:#fff; }

/* ---------- Boutons ---------- */
.btn { --bg:var(--card); display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 18px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink); font:inherit; font-weight:680; font-size:14px; cursor:pointer; transition:transform .12s, box-shadow .15s, background .15s, border-color .15s; text-decoration:none; }
.btn:hover { text-decoration:none; border-color:#b9d1c1; box-shadow:0 5px 14px -9px var(--g900); }
.btn:active { transform:translateY(1px); } .btn:focus-visible { outline:none; box-shadow:var(--ring); }
.btn-primary { background:linear-gradient(135deg,var(--g600),var(--g800)); color:#fff; border-color:var(--g700); box-shadow:0 7px 18px -10px var(--g900); }
.btn-primary:hover { background:linear-gradient(135deg,var(--g500),var(--g700)); border-color:var(--g600); }
.btn-ghost { background:transparent; } .btn-ghost:hover { background:var(--g50); }
.btn-sm { padding:6px 12px; font-size:13px; } .btn-lg { padding:13px 26px; font-size:15.5px; } .btn-block { width:100%; }
.btn[disabled] { opacity:.52; cursor:not-allowed; box-shadow:none; } .btn.danger { color:var(--red); } .btn.danger:hover { background:var(--red-100); border-color:#efb6c0; }

/* ---------- Champs ---------- */
.field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.field > span { font-size:12.5px; font-weight:650; color:var(--ink2); letter-spacing:.2px; }
input[type=text],input[type=password],input[type=search],input[type=email],input[type=number],input[type=date],select,textarea { width:100%; padding:11px 13px; border:1px solid #d2dfd6; border-radius:10px; background:#fff; font:inherit; color:var(--ink); transition:border-color .15s, box-shadow .15s,background .15s; }
select { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364717d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 13px center; padding-right:34px; }
input:focus,select:focus,textarea:focus { outline:none; border-color:var(--g600); box-shadow:var(--ring); }
input:disabled,select:disabled,textarea:disabled { background:var(--g50); color:var(--muted); cursor:not-allowed; }
input::placeholder,textarea::placeholder { color:#89968e; }
input[type=file] { width:100%; padding:8px; border:1px dashed #b9d1c1; border-radius:10px; background:var(--g50); color:var(--ink2); font:inherit; }
input[type=file]::file-selector-button { margin-right:12px; padding:8px 12px; border:0; border-radius:7px; background:var(--g700); color:#fff; font:inherit; font-weight:650; cursor:pointer; }
input[type=file]::file-selector-button:hover { background:var(--g800); }
.input-ico { position:relative; display:flex; align-items:center; }
.input-ico > svg { position:absolute; left:13px; color:var(--muted); pointer-events:none; }
.input-ico > input { padding-left:42px; }
.input-ico > .eye { position:absolute; right:8px; border:0; background:var(--g50); color:var(--g700); font:inherit; font-size:12px; font-weight:650; padding:5px 10px; border-radius:8px; cursor:pointer; }
.input-ico > input#n-mdp { padding-left:13px; padding-right:96px; }
.form-stack { display:grid; gap:16px; } .form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:16px; } .form-grid .full { grid-column:1/-1; }

/* ---------- Alertes, badges, chips ---------- */
.alert { padding:12px 15px; border-radius:var(--r-sm); font-size:14px; margin:0 0 14px; border:1px solid transparent; }
.alert-error { background:var(--red-100); color:var(--red-dark); border-color:#f3bbc5; } .alert-success { background:var(--g100); color:var(--g800); border-color:#bfe3cd; }
.alert-info { background:var(--g50); color:var(--g800); border-color:#c9dfd0; } .alert-warn { background:var(--red-100); color:var(--red-dark); border-color:#f3bbc5; }
.container > .alert { margin-top:16px; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius:999px; font-size:12.5px; font-weight:700; white-space:nowrap; }
.badge-ok { background:var(--g100); color:var(--g800); } .badge-warn { background:var(--red-100); color:var(--red-dark); }
.badge-info { background:var(--g50); color:var(--g800); } .badge-off { background:#f5eeee; color:var(--red-dark); }
.chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.chip { display:inline-flex; flex-direction:column; padding:7px 14px; border-radius:11px; background:var(--g50); border:1px solid var(--line); line-height:1.2; }
.chip small { font-size:10.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); font-weight:650; } .chip strong { font-size:14px; }
.chip-green { background:var(--g100); border-color:#bfe3cd; } .chip-green strong { color:var(--g800); }
.scope { display:flex; gap:10px; flex-wrap:wrap; }

/* ---------- Filtres & tableau ---------- */
.filters { padding:22px; border-top:3px solid var(--g600); }
.filters-grid { display:grid; grid-template-columns:repeat(6, minmax(0,1fr)); gap:14px; } .filters-foot { display:flex; justify-content:flex-end; margin-top:10px; }
.table-card { overflow:hidden; } .table-top { display:flex; justify-content:space-between; align-items:center; padding:16px 22px; border-bottom:1px solid var(--line); gap:12px; background:linear-gradient(90deg,#fff,var(--g50)); }
.per { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; } .per select { width:auto; padding:6px 30px 6px 10px; }
.search { max-width:300px; }
.table-wrap { overflow-x:auto; }
table.grid { width:100%; border-collapse:collapse; font-size:14px; }
.grid th { position:sticky; top:0; background:var(--g50); text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.65px; color:var(--g800); font-weight:750; padding:13px 16px; border-bottom:2px solid #cfe2d5; white-space:nowrap; }
.grid td { padding:13px 16px; border-bottom:1px solid #edf2ee; vertical-align:middle; }
.grid tbody tr { transition:background .14s; } .grid tbody tr:hover td { background:var(--g50); } .grid tbody tr:last-child td { border-bottom:0; }
.grid .num { text-align:right; font-variant-numeric:tabular-nums; } .col-act { width:160px; }
.th-sort { all:unset; cursor:pointer; display:inline-flex; align-items:center; gap:6px; } .th-sort:hover { color:var(--g700); }
.th-sort::after { content:""; width:8px; height:10px; opacity:.35; background:linear-gradient(currentColor,currentColor) center/2px 100% no-repeat; }
.th-sort.asc::after { content:"▲"; font-size:9px; opacity:1; width:auto; height:auto; background:none; color:var(--g700); }
.th-sort.desc::after { content:"▼"; font-size:9px; opacity:1; width:auto; height:auto; background:none; color:var(--g700); }
.btn-voir { display:inline-flex; align-items:center; gap:6px; padding:6px 13px; border-radius:10px; background:var(--g100); color:var(--g800); font-weight:700; font-size:13px; border:1px solid #c7e6d3; transition:all .15s; }
.btn-voir:hover { background:var(--g600); color:#fff; border-color:var(--g600); text-decoration:none; transform:translateY(-1px); box-shadow:0 6px 14px -6px rgba(15,107,63,.7); }
.btn-icon { width:34px; height:34px; padding:0; justify-content:center; }
.btn-edit { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid #c7d9cd; border-radius:10px; background:var(--g50); color:var(--g700); }
.btn-edit:hover { background:var(--g700); color:#fff; text-decoration:none; }
.btn-delete { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; padding:0; border:1px solid #f1c5c5; border-radius:10px; background:var(--red-100); color:var(--red-dark); }
.btn-delete:hover { background:var(--red); color:#fff; }
.pager { display:flex; align-items:center; justify-content:space-between; padding:14px 22px; border-top:1px solid var(--line); background:#fff; }
code { background:var(--g50); color:var(--g800); padding:3px 7px; border-radius:6px; font-size:13px; }
.table-wrap { scrollbar-color:#9bbda5 #f3faf5; scrollbar-width:thin; }

/* ---------- États vides / chargement ---------- */
.state { padding:0; } .empty { text-align:center; padding:46px 24px 40px; } .state .empty { padding:56px 24px; }
.empty-ico { width:64px; height:64px; margin:0 auto 14px; border-radius:18px; background:var(--g100); display:grid; place-items:center; color:var(--g700); } .empty-ico.err { background:var(--red-100); color:var(--red); font-size:30px; font-weight:800; }
.empty h2,.empty h1 { font-size:18px; margin-bottom:6px; } .empty p { color:var(--muted); max-width:460px; margin-inline:auto; }
.skeleton td > div { height:14px; border-radius:7px; background:linear-gradient(90deg,#edf5ef 25%,#fff 37%,#edf5ef 63%); background-size:400% 100%; animation:shimmer 1.3s infinite; }
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:0 0} }

/* ---------- Fiche candidat ---------- */
.hero-card { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:26px; background:linear-gradient(115deg,#fff 55%,var(--g50)); border-left:4px solid var(--g600); } .hero-id { display:flex; align-items:center; gap:18px; }
.hero-card .badge { font-size:14px; padding:8px 18px; }
.dl { display:grid; grid-template-columns:1fr 1fr; gap:16px 20px; margin:16px 0 0; } .dl dt { font-size:11.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); font-weight:700; } .dl dd { margin:2px 0 0; font-weight:650; }
.gauge-row { display:flex; align-items:center; gap:26px; margin-top:16px; flex-wrap:wrap; }
.gauge { --p:0; width:150px; height:150px; border-radius:50%; background:conic-gradient(var(--g600) calc(var(--p) * 1%), #e7efe9 0); display:grid; place-items:center; flex:none; }
.gauge-in { width:118px; height:118px; border-radius:50%; background:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; box-shadow:inset 0 0 0 1px var(--line); }
.gauge-in strong { font-size:26px; letter-spacing:-.02em; } .gauge-in strong small { font-size:14px; } .gauge-in span { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; font-weight:650; }
.totals { display:grid; gap:12px; } .totals div { display:flex; flex-direction:column; } .totals span { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; font-weight:650; } .totals strong { font-size:24px; letter-spacing:-.01em; }
.score .alert { margin-top:16px; margin-bottom:0; }
table.notes td, table.notes th { padding:13px 22px; } .bar-col { width:34%; }
.bar { height:8px; border-radius:99px; background:#e7efe9; overflow:hidden; } .bar i { display:block; height:100%; border-radius:99px; background:var(--g500); } .bar.low i { background:var(--red); }
.notes tfoot td { font-weight:750; background:var(--g50); border-top:2px solid var(--line); border-bottom:0; } .notes tfoot tr.pct-row td { background:var(--g100); color:var(--g800); font-size:15.5px; }
.actionbar { position:fixed; left:0; right:0; bottom:0; z-index:25; background:rgba(255,255,255,.96); backdrop-filter:blur(12px); border-top:1px solid var(--line); box-shadow:0 -8px 24px -16px rgba(9,39,25,.3); }
.actionbar-in { display:flex; align-items:center; justify-content:space-between; padding-block:12px; }

/* ---------- Boîtes de dialogue ---------- */
.dialog { border:1px solid var(--line); border-radius:18px; padding:0; width:min(460px, 100% - 32px); max-height:calc(100% - 32px); overflow:auto; box-shadow:var(--shadow-lg); } .dialog-wide { width:min(700px, 100% - 32px); }
.dialog::backdrop { background:rgba(9,39,25,.56); backdrop-filter:blur(4px); }
.dialog-in { padding:26px; } .dialog-in .muted { margin:4px 0 16px; }
.dialog-foot { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.choice { display:flex; gap:14px; align-items:flex-start; padding:14px 16px; border:1.5px solid var(--line); border-radius:12px; cursor:pointer; margin-bottom:10px; transition:border-color .15s, background .15s; }
.choice:hover { border-color:#bcd6c7; } .choice:has(input:checked) { border-color:var(--g600); background:var(--g50); }
.choice input { width:19px; height:19px; margin-top:2px; accent-color:var(--g600); flex:none; } .choice-body { display:flex; flex-direction:column; } .choice-body small { color:var(--muted); font-size:12.5px; }
#print-msg { margin-top:12px; margin-bottom:0; }
.toast-ok { position:fixed; right:20px; bottom:90px; background:var(--g800); color:#fff; padding:12px 18px; border-radius:12px; box-shadow:var(--shadow); z-index:60; animation:pop .25s ease; }
@keyframes pop { from{ transform:translateY(8px); opacity:0 } to{ transform:none; opacity:1 } }

/* ---------- Identifiants à transmettre (admin) ---------- */
.creds { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:22px 24px; background:linear-gradient(110deg,var(--g50),#fff); border-color:#bfe3cd; border-left:4px solid var(--g600); flex-wrap:wrap; }
.creds-box { display:flex; gap:26px; margin:0; } .creds-box dt { font-size:11.5px; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); font-weight:700; } .creds-box dd { margin:3px 0 0; } .creds-box code { font-size:16px; background:#fff; border:1px dashed #9ccbb0; padding:5px 10px; }
.import-card { padding:24px; border-top:3px solid var(--red); }
.import-card .muted { margin-top:6px; }
.import-card .tiny { margin-top:8px; }
.import-form { display:flex; align-items:flex-end; gap:14px; margin-top:16px; flex-wrap:wrap; }
.import-form .field { flex:1; }
.score-edit { margin-top:16px; }
.form-grid > .field, .filters-grid > .field { animation:rise-in .3s ease both; }
@keyframes rise-in { from { opacity:.65; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ---------- Connexion ---------- */
.auth { min-height:100vh; display:grid; grid-template-columns:1.05fr 1fr; background:#fff; }
.auth-hero { position:relative; overflow:hidden; color:#fff; background:radial-gradient(900px 520px at 5% -10%,var(--g600) 0%,transparent 56%),linear-gradient(150deg,var(--g800),var(--g950)); display:flex; align-items:center; padding:clamp(32px,6vw,76px); }
.auth-hero::after { content:""; position:absolute; right:0; bottom:0; width:100%; height:7px; background:linear-gradient(90deg,var(--g600) 0 48%,#fff 48% 52%,var(--red) 52% 100%); }
.orb { position:absolute; border-radius:50%; filter:blur(2px); opacity:.14; background:#fff; } .o1 { width:420px; height:420px; right:-120px; top:-100px; } .o2 { width:240px; height:240px; left:-70px; bottom:40px; background:var(--red); opacity:.16; } .o3 { width:120px; height:120px; right:20%; bottom:12%; }
.hero-in { position:relative; max-width:520px; } .hero-in img { margin-bottom:22px; box-shadow:0 14px 30px -10px rgba(0,0,0,.45); border-radius:16px; }
.eyebrow { text-transform:uppercase; letter-spacing:2px; font-size:12px; font-weight:700; opacity:.8; } .hero-in h1 { font-size:46px; line-height:1.05; letter-spacing:-.02em; margin:6px 0 16px; }
.lead { font-size:17px; opacity:.92; line-height:1.55; } .hero-list { list-style:none; padding:0; margin:28px 0 0; display:grid; gap:12px; } .hero-list li { display:flex; gap:12px; align-items:center; font-weight:550; }
.hero-list span { width:25px; height:25px; border-radius:8px; background:rgba(255,255,255,.16); display:grid; place-items:center; font-size:13px; flex:none; }
.auth-panel { display:grid; place-items:center; padding:clamp(22px,5vw,64px); background:linear-gradient(145deg,#fff,var(--g50)); }
.auth-card { width:min(440px,100%); background:#fff; border:1px solid var(--line); border-top:4px solid var(--g600); border-radius:18px; padding:clamp(24px,4vw,40px); box-shadow:var(--shadow-lg); display:grid; gap:18px; }
.auth-card h2 { font-size:29px; letter-spacing:-.035em; color:var(--g950); } .auth-card .alert { margin:0; }
.auth-card .tiny { line-height:1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .filters-grid { grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width: 900px) {
  .auth { grid-template-columns:1fr; } .auth-hero { display:none; } .auth-panel { min-height:100vh; }
  .grid-2 { grid-template-columns:1fr; } .who-txt { display:none; } .brand-txt small { display:none; }
  .hero-card { flex-direction:column; align-items:flex-start; }
}
@media (max-width: 620px) {
  .filters-grid { grid-template-columns:1fr 1fr; } .form-grid { grid-template-columns:1fr; } .topbar-in { gap:10px; width:calc(100% - 24px); flex-wrap:wrap; padding-block:10px; } .nav { order:3; flex-basis:100%; overflow-x:auto; margin:0; } .nav a { padding:7px 10px; white-space:nowrap; }
  .container { width:calc(100% - 24px); } main.container { padding-block:20px 110px; }
  .dl { grid-template-columns:1fr; } .btn span { display:none; } .actionbar .btn span { display:inline; }
  .h1 { font-size:22px; } .table-top { flex-wrap:wrap; } .creds-box { flex-direction:column; gap:12px; }
  .filters { padding:16px; } .card.pad { padding:18px; } .hero-card { padding:18px; }
  .auth-panel { padding:18px; } .auth-card { border-radius:16px; }
}
@media print { .topbar,.actionbar,.back,.foot { display:none !important; } body { background:#fff; } .card { box-shadow:none; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
