/* Charte celduc® : police Inter, accent violet, thème sombre par défaut et thème clair */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Thème sombre (défaut) */
  --bg-base: #08060d; --bg: #100c1c; --surface: #150f27; --surface-2: #1c1536; --input: #241a42;
  --line: #2a2148; --line-strong: #3a2f5e;
  --ink: #f1ecfb; --ink-2: #c9c0e2; --muted: #8d83b0; --faint: #6b6290;
  --link: #b574e8; --accent: #9b4ddb; --accent-hover: #b574e8; --accent-dark: #6a27a6; --accent-ink: #ffffff; --accent-soft: rgba(155, 77, 219, .16);
  --good: #34d399; --good-soft: rgba(52, 211, 153, .14); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
  --bad: #fc6b6b; --bad-soft: rgba(252, 107, 107, .14); --info: #b9a6ea; --info-soft: rgba(185, 166, 234, .14);
  --radius: 10px; --radius-lg: 14px; --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg-base: #f3f0f9; --bg: #f8f6fc; --surface: #ffffff; --surface-2: #f3eefb; --input: #ffffff;
  --line: #e4ddf1; --line-strong: #cfc4e6;
  --ink: #1e1633; --ink-2: #3d3459; --muted: #564c73; --faint: #8a80a6;
  --link: #7d33c2; --accent: #7d33c2; --accent-hover: #9b4ddb; --accent-dark: #5b2192; --accent-ink: #ffffff; --accent-soft: #efe5fa;
  --good: #0f8f63; --good-soft: #e3f5ee; --warn: #a86a00; --warn-soft: #fdf1dc; --bad: #cc3333; --bad-soft: #fde8e8;
  --info: #5b2192; --info-soft: #efe5fa; --shadow: 0 1px 2px rgba(30, 22, 51, .06), 0 1px 3px rgba(30, 22, 51, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 18px; font-weight: 650; } h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hidden { display: none !important; }

/* Marque : celduc® en minuscules, gras, ® en exposant */
.brand { font-weight: 800; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.brand sup { font-size: .5em; font-weight: 700; vertical-align: super; margin-left: .05em; }
.brand-line { display: flex; flex-direction: column; gap: 2px; }
.brand-line .brand { font-size: 26px; line-height: 1; }
.brand-line .sub { font-size: 13px; color: var(--muted); font-weight: 550; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-good { background: var(--good); border-color: var(--good); color: #08060d; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; min-height: 50px; font-size: 16px; border-radius: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--input); color: var(--ink); font: inherit; font-size: 16px; }
textarea { min-height: 70px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.stack > * + * { margin-top: 12px; }

/* Puces de statut */
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.chip-muted { background: var(--surface-2); color: var(--muted); }
.chip-info { background: var(--info-soft); color: var(--info); } .chip-accent { background: var(--accent-soft); color: var(--accent-hover); }
[data-theme="light"] .chip-accent { color: var(--accent); }
.chip-good { background: var(--good-soft); color: var(--good); } .chip-warn { background: var(--warn-soft); color: var(--warn); } .chip-bad { background: var(--bad-soft); color: var(--bad); }
.flag { font-size: 12px; font-weight: 650; color: var(--warn); } .flag-bad { color: var(--bad); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.banner { padding: 10px 12px; border-radius: var(--radius); font-size: 14px; }
.banner-warn { background: var(--warn-soft); color: var(--warn); } .banner-info { background: var(--accent-soft); color: var(--ink); } .banner-bad { background: var(--bad-soft); color: var(--bad); }
.banner-good { background: var(--good-soft); color: var(--good); }

/* Modales, feuilles d'actions et notifications */
.modal-wrap { position: fixed; inset: 0; background: rgba(8, 6, 13, .6); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.modal-wide { max-width: 980px; }
.modal h2 { margin-bottom: 14px; }
.modal-text { font-size: 16px; margin: 4px 0 8px; }
@media (min-width: 700px) { .modal-wrap { align-items: center; } .modal { border-radius: 16px; padding: 22px; } }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: opacity .4s; }
.toast-bad { background: var(--bad); border-color: var(--bad); color: #fff; } .toast.out { opacity: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; }
.tl-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; }

/* Connexion : fond sombre et halos violets */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(600px 400px at 15% 10%, rgba(155, 77, 219, .28), transparent 60%),
  radial-gradient(500px 380px at 90% 90%, rgba(106, 39, 166, .30), transparent 60%), var(--bg-base); }
.login .card { width: min(100%, 390px); padding: 30px 24px; }
.login-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.lang-switch button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.lang-switch button.on { background: var(--accent); color: var(--accent-ink); }
