/* Atelier — feuille de style. Couleurs et composants repris de la maquette
   validée en septembre (maquette/styles.css), réécrits lisiblement. */

:root {
  --bg: #f7f8f2;
  --paper: #fff;
  --ink: #25262a;
  --muted: #70736d;
  --line: #e5e7de;
  --purple: #7355cb;
  --lilac: #e8e1fa;
  --lime: #ddf797;
  --orange: #f8bb91;
  --green: #377450;
  --red: #b3261e;
  --radius: 22px;
  --sidebar: 232px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; letter-spacing: -1.2px; line-height: 1.2; font-weight: 650; }
h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.5px; }
h3 { font-size: 17px; letter-spacing: -.3px; }
code { font-family: Consolas, 'Courier New', monospace; font-size: .95em; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

svg.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.6px; font-size: 12px; font-weight: 700; color: var(--purple); margin-bottom: 6px; }
.mt { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.loading { padding: 40px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Marque ---------------------------------------------------------------- */

.brand { font-size: 32px; font-weight: 750; letter-spacing: -2px; display: inline-flex; align-items: center; gap: 8px; }
.brand b { font-family: Georgia, serif; font-weight: normal; color: var(--purple); font-size: 36px; }
.brand-sub { font-size: 12px; letter-spacing: 1.6px; color: var(--muted); margin: 4px 0 0 2px; }

/* --- Boutons et champs ------------------------------------------------------ */

.btn {
  border: 0; border-radius: 11px; padding: 12px 18px; min-height: 44px;
  display: inline-flex; justify-content: center; align-items: center; gap: 9px;
  font-weight: 600; font-size: 14px; line-height: 1.4;
  background: var(--ink); color: #fff;
  transition: transform .15s, background .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); background: #3d3d44; }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.lime:hover:not(:disabled) { background: #cce985; }
.btn.light { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn.light:hover:not(:disabled) { background: #f4f4ed; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: #efefe7; }
.btn.compact { min-height: 36px; padding: 7px 12px; font-size: 13px; }

.form-stack { display: grid; gap: 18px; }
.form-label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 8px; }
.field { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 12px; }
.field:focus { outline: 2px solid #ac94e8; outline-offset: 2px; }
.field.count { width: 84px; }
.form-error { color: var(--red); font-size: 14px; min-height: 21px; }
.form-error:empty { min-height: 0; }

/* --- Écrans de connexion ------------------------------------------------------ */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; padding: 34px; }
.auth-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 30px; }
.auth-card h1 { font-size: 28px; }
.auth-card p.muted { margin-top: 6px; }
.auth-card .btn.ghost { margin-top: 12px; width: 100%; }

/* --- Choix de la langue -------------------------------------------------------- */

.lang-switch { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--paper); }
.lang-switch button {
  border: 0; background: transparent; border-radius: 8px; min-height: 32px; padding: 4px 9px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { background: var(--ink); color: #fff; }

/* --- Cadre de l'application -------------------------------------------------- */

.sidebar {
  width: var(--sidebar); position: fixed; inset: 0 auto 0 0; z-index: 20;
  padding: 30px 20px 20px; display: flex; flex-direction: column;
  background: var(--paper); border-right: 1px solid var(--line);
}
.sidebar .brand-sub { margin-bottom: 40px; }
.nav-caption { font-size: 11px; letter-spacing: 1.8px; color: #8b8d85; margin: 0 12px 14px; }
.nav { display: grid; gap: 6px; }
.nav-item {
  padding: 12px 14px; border-radius: 12px; display: flex; align-items: center; gap: 13px;
  font-size: 15px; color: #686b65; transition: background .18s;
}
a.nav-item:hover { background: #f4f4ed; }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-item.active svg { color: var(--lime); }
.nav-item.soon { opacity: .55; cursor: default; }
.nav-item.soon em { margin-left: auto; font-style: normal; font-size: 11px; background: #f1f2ea; border-radius: 6px; padding: 2px 6px; }
.sidebar-course { margin-top: auto; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 2px; }

.app-body { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  height: 76px; padding: 0 36px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
}
.breadcrumb { font-size: 14px; color: var(--muted); }
.breadcrumb span { color: var(--ink); margin-left: 8px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { font-size: 14px; font-weight: 600; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; background: var(--lilac); border: 3px solid #fff;
}
.icon-btn {
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.menu-toggle { display: none; }

.page { padding: 34px 36px 48px; max-width: 1240px; }
.page-heading { margin-bottom: 26px; }
.page-heading p.muted { margin-top: 8px; }

/* --- Contenus ---------------------------------------------------------------- */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card + .card, .card + .tiles, .stats + .card { margin-top: 18px; }
.card h2 + p { margin-top: 6px; }
.session-card { background: var(--ink); color: #fff; border: 0; }
.session-card .eyebrow { color: var(--lime); }
.session-card p.muted { color: #c9cac4; margin-top: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.tile { display: grid; gap: 8px; align-content: start; }
.tile svg { color: var(--purple); width: 24px; height: 24px; }
.tile .badge { justify-self: start; margin-top: 6px; }

.badge { font-size: 12px; padding: 4px 10px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; background: #f2f3ec; white-space: nowrap; }
.badge.ok { background: #e3f1e6; color: var(--green); }
.badge.todo { background: #fff1e5; color: #9a4d16; }
.badge.off { background: #f1f1f1; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.stat strong { display: block; font-size: 34px; letter-spacing: -1px; line-height: 1.1; }

.empty { text-align: center; padding: 40px 24px; }
.empty .btn { margin-top: 18px; }
.warning { background: #fff1e5; color: #7c3d10; border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-weight: 600; }

/* --- Le direct ---------------------------------------------------------------- */

.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green); white-space: nowrap; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live-dot.reconnecting { color: #b4610f; }
.live-dot.reconnecting i { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.pause-banner {
  margin: 18px 36px 0; padding: 14px 18px; border-radius: 16px;
  background: var(--lime); color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pause-banner strong { font-size: 17px; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.segmented button { border: 0; background: transparent; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented button.active { background: var(--ink); color: #fff; }

.now-next { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.now-card { border: 2px solid var(--purple); }
.now-card h2 { font-size: 24px; margin-top: 4px; }
.now-card.is-break { border-color: var(--lime); }
.next-card h3 { margin-top: 4px; }

.timeline, .step-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.timeline li, .step-list li { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 10px; }
.timeline time, .step-list time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 44px; }
.timeline li.done, .step-list li.done { opacity: .5; }
.timeline li.now, .step-list li.now { background: var(--lilac); font-weight: 600; }
.timeline li.is-break span, .step-list li.is-break .step-title { font-style: italic; color: var(--muted); }
.step-list .step-title { flex: 1; min-width: 0; }

/* --- Éditeur du déroulé -------------------------------------------------------- */

.agenda-table td { padding: 8px 10px; }
.agenda-table .field { padding: 9px 10px; }
.agenda-table .field.time { width: 110px; }
.agenda-table td:nth-child(3) { min-width: 220px; }
.agenda-table td:nth-child(4), .agenda-table td:nth-child(5) { min-width: 160px; }
.form-actions { padding: 14px 18px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.table-card .empty { padding: 30px 18px; }

/* --- Tableau des participants ---------------------------------------------- */

.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.is-disabled td:not(.actions) { opacity: .5; }
td.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* --- Fiches de connexion ------------------------------------------------------ */

.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.credential { border: 1.5px dashed #b9bcb1; border-radius: 14px; padding: 18px 20px; background: var(--paper); break-inside: avoid; }
.credential-brand { font-weight: 750; font-size: 20px; letter-spacing: -1px; }
.credential-brand b { font-family: Georgia, serif; font-weight: normal; color: var(--purple); }
.credential-brand span { font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
.credential dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 10px; }
.credential dt { color: var(--muted); font-size: 13px; }
.credential dd { margin: 0; font-weight: 600; word-break: break-all; }
.credential dd code { font-size: 17px; letter-spacing: .5px; }
.credential p { font-size: 12px; color: var(--muted); }

@media print {
  .sidebar, .topbar, .no-print, #toast { display: none !important; }
  .app-body { margin: 0; }
  .page { padding: 0; max-width: none; }
  body, .credential { background: #fff; }
  .sheet { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* --- Message éphémère --------------------------------------------------------- */

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }

/* --- Petits écrans : le menu se replie ------------------------------------- */

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px #0002; }
  .sidebar.open { transform: none; }
  .app-body { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 16px; height: 64px; }
  .page { padding: 24px 16px 40px; }
  .who, .breadcrumb, .top-actions .btn span, .live-dot span { display: none; }
  h1 { font-size: 27px; }
  td.actions { justify-content: flex-start; }
  .pause-banner { margin: 14px 16px 0; }
  .now-next { grid-template-columns: 1fr; }
}
