:root {
  /* Direct Acquis tokens (irve-direct-site CustomStyles.astro) — light only, like the site */
  --bg: #f5f5f7;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #0b5cff;
  --accent-ink: #ffffff;
  --highlight: #ffd60a;
  --ok: #1f8a4c;
  --radius: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea {
  font: inherit;
  color: inherit;
}
.btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 980px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=url], textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
textarea { min-height: 260px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }

/* Login */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.login form {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 14px;
}
.login h1 { margin: 0; font-size: 22px; }
.err { color: #d33; font-size: 14px; min-height: 1em; }

/* App layout */
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top .brand { font-weight: 700; }
.top .brand { display: flex; align-items: center; gap: 10px; }
.top .brand img { height: 28px; width: auto; }
.top .brand span { color: var(--muted); font-weight: 500; }
.main h1, .login h1 { letter-spacing: -0.02em; }
::selection { background: var(--highlight); color: #0a0a0a; }
.top .spacer { flex: 1; }
.progress { font-size: 14px; color: var(--muted); }
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 57px);
}
.side {
  border-right: 1px solid var(--line);
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 6px;
}
.mod-link {
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}
.mod-link:hover { background: var(--panel); }
.mod-link.active { background: var(--panel); border-color: var(--line); }
.mod-num {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--line);
}
.mod-link.done .mod-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.main { padding: 28px 32px 120px; max-width: 860px; width: 100%; }
.main h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; }
.main .summary { color: var(--muted); margin: 0 0 20px; }
.video {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 24px;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content h2 { font-size: 21px; margin: 28px 0 8px; }
.content h3 { font-size: 18px; margin: 22px 0 6px; }
.content blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 4px solid var(--accent);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
}
.content code { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.done-bar { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }
.empty { color: var(--muted); }

/* Chat */
.chat-toggle {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 20;
  border-radius: 999px;
  padding: 14px 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.chat {
  position: fixed;
  right: 16px; bottom: 80px;
  width: min(420px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  display: none;
  flex-direction: column;
  z-index: 20;
}
.chat.open { display: flex; }
.chat header { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.chat header small { display: block; font-weight: 400; color: var(--muted); }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: grid; align-content: start; gap: 10px; }
.msg { padding: 10px 12px; border-radius: 10px; max-width: 90%; white-space: pre-wrap; font-size: 15px; }
.msg.user { background: var(--accent); color: var(--accent-ink); justify-self: end; }
.msg.model { background: var(--bg); border: 1px solid var(--line); }
.chat form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }

/* Admin */
.admin { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
.admin-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.admin-list { display: grid; gap: 6px; align-content: start; }
.admin-item { display: flex; gap: 6px; align-items: center; }
.admin-item .mod-link { flex: 1; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.on { color: var(--ok); border-color: var(--ok); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; display: none; z-index: 50; }
.toast.show { display: block; }

@media (max-width: 760px) {
  .layout, .admin-grid { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 20px 16px 120px; }
}

/* Espace entreprise additions */
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 14px; }
.login .card h1 { margin: 0; font-size: 24px; }
.login .card p { margin: 0; }
.auth-logo { height: 32px; width: auto; justify-self: start; }
.login a { color: var(--accent); }
input[type=email] { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.top a.brand { text-decoration: none; }
.side-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.video video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.users { display: grid; gap: 8px; }
.user-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.user-row .who { display: grid; }
.user-row .who small { color: var(--muted); }
.tag.pending { color: #b26a00; border-color: #b26a00; }
.tag.refused { color: #d33; border-color: #d33; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs .btn.ghost.active { background: var(--ink); color: #fff; border-color: var(--ink); }
