/* Formations Vizcab : charte Vizcab 2.0 (design system). Fond clair, navy + turquoise en aplats, Montserrat. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300&family=Roboto:wght@400;500;700&display=swap');
:root {
  color-scheme: light;
  --bg: #F8FAFB; --side: #1C334F; --surface: #FFFFFF; --surface-2: #F8FAFB; --mint: #E4FBF4;
  --fill: rgba(28, 51, 79, .05); --fill-2: rgba(28, 51, 79, .09);
  --ink: #1C334F; --ink-2: #415978; --muted: #6E839C; --line: #E2E6EA; --line-strong: #C6CCD2;
  --accent: #00D9C7; --accent-hover: #00B5A2; --on-accent: #1C334F; --accent-ink: #009E8C; --accent-soft: #E4FBF4;
  --primary: #1C334F; --on-primary: #FFFFFF;
  --success: #1F9E73; --warning: #B9771A; --danger: #D83729;
  --success-soft: #E0F4EC; --warning-soft: #FBF0DC; --danger-soft: #FBE3E0;
  --fill-art: #EEF2F6; --fill-art-2: #DCE3EC; --paper: #FFFFFF;
  --art-line: rgba(28, 51, 79, .07); --art-dot: rgba(28, 51, 79, .09);
  --shadow-1: 0 1px 2px rgba(28, 51, 79, .06), 0 6px 20px rgba(28, 51, 79, .06);
  --shadow-2: 0 24px 64px rgba(28, 51, 79, .2);
  --r-lg: 16px; --r-md: 12px; --r-sm: 10px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-data: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; transition: background-color .2s ease-out, color .2s ease-out; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 800; }
a { color: var(--accent-ink); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.ic-lg { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.only-light { display: inline; } .only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; } :root[data-theme="dark"] .only-dark { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .only-light { display: none; } :root:not([data-theme="light"]) .only-dark { display: inline; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 0; cursor: pointer; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; white-space: nowrap; transition: background-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: var(--fill); }
.btn-quiet { background: transparent; color: var(--ink-2); height: 34px; padding: 0 10px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 14px; }
.btn-quiet:hover { background: var(--fill); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 14px; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Champs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .textarea, .select { width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px rgba(0, 217, 199, .25); }
.field.error .input, .field.error .textarea { border-color: var(--danger); }
.err { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* Cartes, pastilles */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }
.pill.ok { background: var(--success-soft); color: var(--success); }
.pill.warn { background: var(--warning-soft); color: var(--warning); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.live { background: var(--accent-soft); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Bloc date */
.dateblock { width: 64px; flex: none; border-radius: var(--r-md); overflow: hidden; text-align: center; box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
.dateblock .m { display: block; background: var(--accent); color: var(--ink) !important; color: var(--on-primary); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 0; }
.dateblock .d { display: block; font-family: var(--font-data); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; padding: 6px 0 0; letter-spacing: -.02em; }
.dateblock .w { display: block; font-size: 11.5px; color: var(--muted); padding: 0 0 7px; text-transform: capitalize; }
.dateblock.sm { width: 50px; } .dateblock.sm .d { font-size: 19px; padding-top: 4px; } .dateblock.sm .w { display: none; } .dateblock.sm .m { font-size: 10.5px; padding: 3px 0; }

/* Jauge */
.meter { height: 6px; border-radius: 6px; background: var(--fill-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.meter.hot span { background: var(--accent); }

/* Panneau latéral */
.scrim { position: fixed; inset: 0; background: rgba(28, 51, 79, .32); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 41; box-shadow: var(--shadow-2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.panel.on { transform: none; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.panel-body { flex: 1; overflow: auto; padding: 22px 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.panel-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); }
.x { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; flex: none; }
.x:hover { background: var(--fill); color: var(--ink); }
@media (max-width: 640px) {
  .panel { top: auto; width: 100vw; height: 92vh; border-radius: 20px 20px 0 0; transform: translateY(100%); }
}

/* Dialogue de confirmation */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(14, 16, 18, .45); }
.dlg { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.dlg h3 { font-size: 18px; }
.dlg .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--primary); color: var(--on-primary); padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center; animation: up .2s ease-out; }
.toast.bad { background: var(--danger); color: #fff; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }

/* Squelettes */
.sk { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Fond du haut de page */
.hero-art { position: absolute; inset: 0 0 auto 0; height: 380px; pointer-events: none; overflow: hidden; z-index: 0; }

/* État vide */
.empty { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .illu { width: 200px; height: auto; margin-bottom: 4px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--muted); max-width: 44ch; }
