/* Évaluations de la formation SUGEFP : feuille de style commune (lot 0).
   Les lots peuvent ajouter leurs classes dans public/css/<lot>.css (variable extraCss). */

:root {
  --acc-nuit: #0B1730;
  --acc-nuit-2: #13244a;
  --acc-bleu: #0A5BE0;
  --acc-bleu-fonce: #0848b3;
  --acc-bleu-pale: #e8f0fd;
  --sndi-orange: #F47B20;
  --sndi-orange-pale: #fff1e6;
  --sndi-vert: #6BB536;
  --sndi-vert-pale: #edf7e6;

  --texte: #1a2233;
  --texte-doux: #5a6478;
  --bordure: #dde3ec;
  --bordure-forte: #c4cdda;
  --fond: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  --ok: #2f7d1e;
  --ok-fond: #eaf6e2;
  --ko: #b42318;
  --ko-fond: #fdecea;
  --attente: #a35200;
  --attente-fond: #fff3e6;

  --rayon: 10px;
  --rayon-petit: 6px;
  --ombre: 0 1px 2px rgba(11, 23, 48, 0.06), 0 4px 16px rgba(11, 23, 48, 0.06);
  --ombre-forte: 0 2px 6px rgba(11, 23, 48, 0.08), 0 16px 40px rgba(11, 23, 48, 0.12);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --largeur: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--acc-bleu); text-underline-offset: 2px; }
a:hover { color: var(--acc-bleu-fonce); }

h1, h2, h3, h4 { color: var(--acc-nuit); line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid rgba(10, 91, 224, 0.45); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--surface); color: var(--acc-nuit); padding: 8px 14px; border-radius: var(--rayon-petit);
  box-shadow: var(--ombre);
}
.skip-link:focus { top: 12px; }

/* ---------- En-tête ---------- */
.site-header {
  background: var(--acc-nuit);
  color: #fff;
  border-bottom: 3px solid var(--acc-bleu);
  position: relative;
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, var(--acc-bleu) 0 70%, var(--sndi-orange) 70% 85%, var(--sndi-vert) 85% 100%);
}
.header-inner {
  max-width: var(--largeur); margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
/* Petit logo : on ne montre que le cube du logo ACC (recadrage du fichier 1448 x 1086). */
.brand-logo {
  flex: none; position: relative; display: block;
  width: 44px; height: 44px; background: #fff; border-radius: var(--rayon-petit); overflow: hidden;
}
.brand-logo img {
  position: absolute; left: 1px; top: -16px;
  width: 101px; height: 76px; max-width: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1.02rem; font-weight: 700; }
.brand-text span { font-size: 0.78rem; color: #aeb9d0; }

.main-nav { flex: 1 1 auto; min-width: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav a {
  display: block; padding: 8px 12px; border-radius: var(--rayon-petit);
  color: #d5ddee; text-decoration: none; font-weight: 550; font-size: 0.95rem;
}
.main-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.main-nav a.active, .main-nav a[aria-current="page"] { background: var(--acc-bleu); color: #fff; }

.user-box { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-ident { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-name { font-weight: 600; font-size: 0.92rem; }
.user-role { font-size: 0.75rem; color: #f9b37d; }
.logout-form { margin: 0; }
.btn.btn-logout { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn.btn-logout:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; }

/* ---------- Mise en page ---------- */
.container {
  width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 28px 24px 48px; flex: 1 0 auto;
}
.page-header { margin-bottom: 24px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 4px 0 0; flex-basis: 100%; }
.section-title {
  font-size: 1.1rem; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--bordure);
}

.site-footer { background: var(--surface); border-top: 1px solid var(--bordure); color: var(--texte-doux); font-size: 0.85rem; }
.footer-inner {
  max-width: var(--largeur); margin: 0 auto; padding: 16px 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
}
.page-auth .site-footer { display: none; }

.muted { color: var(--texte-doux); }
.empty {
  color: var(--texte-doux); text-align: center; padding: 28px 16px;
  border: 1px dashed var(--bordure-forte); border-radius: var(--rayon); background: var(--surface-2); margin: 0;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 24px; margin-bottom: 24px; min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin: -24px -24px 20px; padding: 16px 24px; border-bottom: 1px solid var(--bordure);
  background: var(--surface-2); border-radius: var(--rayon) var(--rayon) 0 0;
}
.card-header h2, .card-header h3 { margin: 0; }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid + .card, .grid + .grid { margin-top: 24px; }

/* ---------- Tuiles chiffres clés ---------- */
.stat {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 18px 20px; border-top: 4px solid var(--acc-bleu);
}
.grid > .stat:nth-child(3n + 2) { border-top-color: var(--sndi-orange); }
.grid > .stat:nth-child(3n + 3) { border-top-color: var(--sndi-vert); }
.stat-value { display: block; font-size: 2rem; font-weight: 750; color: var(--acc-nuit); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 6px; color: var(--texte-doux); font-size: 0.9rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 18px; border-radius: var(--rayon-petit);
  border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--acc-nuit);
  font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--acc-bleu); color: var(--acc-bleu); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--acc-bleu); border-color: var(--acc-bleu); color: #fff; }
.btn-primary:hover { background: var(--acc-bleu-fonce); border-color: var(--acc-bleu-fonce); color: #fff; }
.btn-secondary { background: var(--acc-bleu-pale); border-color: transparent; color: var(--acc-bleu-fonce); }
.btn-secondary:hover { background: #d6e4fb; border-color: transparent; color: var(--acc-nuit); }
.btn-danger { background: var(--surface); border-color: #e6b4ae; color: var(--ko); }
.btn-danger:hover { background: var(--ko); border-color: var(--ko); color: #fff; }
.btn-small { min-height: 32px; padding: 5px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Tableaux ---------- */
.table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--bordure); border-radius: var(--rayon-petit); margin-bottom: 16px;
}
.table-wrap > .table { margin-bottom: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: var(--surface); margin-bottom: 16px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.table thead th {
  background: var(--surface-2); color: var(--texte-doux); font-weight: 650; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
}
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody tr:hover { background: #f9fbff; }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 650; line-height: 1.4; white-space: nowrap;
  background: #eef1f6; color: var(--texte-doux); border: 1px solid transparent;
}
.badge-ok { background: var(--ok-fond); color: var(--ok); border-color: #cbe7bb; }
.badge-ko { background: var(--ko-fond); color: var(--ko); border-color: #f4c7c2; }
.badge-neutre { background: #eef1f6; color: #4a5468; border-color: #dfe4ec; }
.badge-info { background: var(--acc-bleu-pale); color: var(--acc-bleu-fonce); border-color: #c9dbfa; }
.badge-attente { background: var(--attente-fond); color: var(--attente); border-color: #fbd7b4; }

/* ---------- Alertes ---------- */
.flashes { margin-bottom: 20px; }
.alert {
  padding: 12px 16px; border-radius: var(--rayon-petit); margin-bottom: 12px;
  border: 1px solid transparent; border-left-width: 4px; font-size: 0.95rem;
}
.alert ul { margin: 0; padding-left: 20px; }
.alert-succes { background: var(--ok-fond); border-color: #cbe7bb; border-left-color: var(--sndi-vert); color: #24611a; }
.alert-erreur { background: var(--ko-fond); border-color: #f4c7c2; border-left-color: var(--ko); color: #8f1c13; }
.alert-info { background: var(--acc-bleu-pale); border-color: #c9dbfa; border-left-color: var(--acc-bleu); color: #0c3c8c; }

/* ---------- Formulaires ---------- */
.form-field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field label, .form-field .label { font-weight: 600; font-size: 0.92rem; color: var(--acc-nuit); }
.form-field input[type="text"], .form-field input[type="email"], .form-field input[type="password"],
.form-field input[type="number"], .form-field input[type="date"], .form-field select, .form-field textarea,
.question input[type="text"], .question input[type="number"], .question textarea {
  width: 100%; max-width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; color: var(--texte); background: var(--surface);
  border: 1px solid var(--bordure-forte); border-radius: var(--rayon-petit);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field textarea, .question textarea { min-height: 96px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.question input:focus, .question textarea:focus {
  outline: none; border-color: var(--acc-bleu); box-shadow: 0 0 0 3px rgba(10, 91, 224, 0.18);
}
.field-help { color: var(--texte-doux); font-size: 0.82rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.form-inline { display: inline; margin: 0; }

/* ---------- Questions ---------- */
.question {
  border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface);
  padding: 18px 20px; margin: 0 0 16px; min-width: 0;
}
.question legend { padding: 0; float: left; width: 100%; }
.question legend + * { clear: both; }
.question-enonce { font-weight: 600; color: var(--acc-nuit); margin-bottom: 12px; display: block; }
.question-enonce .num { color: var(--acc-bleu); margin-right: 6px; }
.question.has-error { border-color: var(--ko); box-shadow: 0 0 0 1px var(--ko); }
.question .question-error { color: var(--ko); font-size: 0.88rem; font-weight: 600; margin-top: 8px; }
.choix-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choix-list label {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--bordure); border-radius: var(--rayon-petit); background: var(--surface-2);
  transition: border-color 0.15s, background-color 0.15s;
}
.choix-list label:hover { border-color: var(--acc-bleu); background: #f5f9ff; }
.choix-list input { margin-top: 4px; flex: none; width: 18px; height: 18px; accent-color: var(--acc-bleu); }
.choix-list label:has(input:checked) { border-color: var(--acc-bleu); background: var(--acc-bleu-pale); }
.choix-list .nsp label { background: transparent; border-style: dashed; color: var(--texte-doux); }
.choix-list .correct label, .choix-list li.correct {
  border-color: var(--sndi-vert); background: var(--sndi-vert-pale);
}

/* Tableau d'échelle (auto-positionnement) */
.echelle-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.echelle-table th, .echelle-table td { border-bottom: 1px solid var(--bordure); padding: 10px 8px; text-align: center; vertical-align: middle; }
.echelle-table thead th { background: var(--surface-2); font-size: 0.78rem; color: var(--texte-doux); font-weight: 650; }
.echelle-table th[scope="row"], .echelle-table td:first-child { text-align: left; font-weight: 600; color: var(--acc-nuit); }
.echelle-table input { width: 20px; height: 20px; accent-color: var(--acc-bleu); }

/* ---------- Progression ---------- */
.progress {
  width: 100%; height: 10px; background: #e4e9f1; border-radius: 999px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--acc-bleu), var(--sndi-vert));
  border-radius: 999px; transition: width 0.3s;
}

/* ---------- Pages de connexion ---------- */
.page-auth {
  background:
    radial-gradient(circle at 12% 0%, rgba(10, 91, 224, 0.35), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(244, 123, 32, 0.18), transparent 40%),
    var(--acc-nuit);
}
.page-auth .container { display: flex; align-items: center; justify-content: center; padding-top: 40px; padding-bottom: 40px; }
.auth-wrap { width: 100%; max-width: 520px; }
.auth-card { padding: 0; overflow: hidden; box-shadow: var(--ombre-forte); border: 0; margin-bottom: 16px; }
.auth-logos {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 22px 28px; background: #fff; border-bottom: 1px solid var(--bordure); position: relative;
}
.auth-logos::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--acc-nuit) 0 35%, var(--acc-bleu) 35% 65%, var(--sndi-orange) 65% 85%, var(--sndi-vert) 85% 100%);
}
.auth-logo { flex: 1 1 0; display: flex; align-items: center; justify-content: center; height: 96px; min-width: 0; overflow: hidden; }
.auth-logo img { height: 100%; width: 100%; object-fit: contain; mix-blend-mode: multiply; }
/* Les deux fichiers ont de larges marges blanches : on recadre par agrandissement. */
.auth-logo:first-child img { transform: scale(1.5); }
.auth-logo:last-child img { transform: scale(1.6); }
.auth-logos-sep { flex: none; width: 1px; height: 64px; background: var(--bordure); }
.auth-body { padding: 28px 32px 30px; }
.auth-kicker {
  margin: 0 0 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sndi-orange);
}
.auth-body h1 { font-size: 1.45rem; margin-bottom: 8px; }
.auth-intro { color: var(--texte-doux); margin-bottom: 22px; }
.auth-form .form-actions { margin-top: 4px; }
.auth-form .grid { gap: 0 16px; }
.auth-switch { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--bordure); font-size: 0.93rem; color: var(--texte-doux); text-align: center; }
.auth-switch a { font-weight: 650; }
.auth-footnote { text-align: center; color: #9eabc6; font-size: 0.82rem; margin: 0; }

/* ---------- Divers ---------- */
.info-list { margin: 0; display: grid; gap: 12px; }
.info-list > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.info-list dt { color: var(--texte-doux); font-size: 0.9rem; }
.info-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.compte-grid { align-items: start; }

.error-card { max-width: 640px; margin: 24px auto; text-align: center; padding: 40px 28px; }
.error-card .form-actions { justify-content: center; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--acc-bleu); margin: 0 0 4px; line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { gap: 12px 16px; }
  .main-nav { order: 3; flex-basis: 100%; }
  .main-nav a { white-space: nowrap; padding: 6px 10px; font-size: 0.9rem; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.4rem; }
  .container { padding: 20px 16px 36px; }
  .header-inner { padding: 10px 16px; }
  .footer-inner { padding: 14px 16px; }
  .brand-text span { display: none; }
  .user-ident { display: none; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .card-header { margin: -18px -16px 16px; padding: 14px 16px; }
  .question { padding: 14px; }
  .table th, .table td { padding: 8px 10px; }
  .form-actions .btn { flex: 1 1 auto; }

  .page-auth .container { padding: 16px; align-items: flex-start; }
  .auth-logos { flex-direction: column; gap: 12px; padding: 18px 16px; }
  .auth-logo { flex: none; width: 100%; height: 80px; }
  .auth-logos-sep { width: 64px; height: 1px; }
  .auth-body { padding: 22px 16px 24px; }
}
