/* Wonder Cambodia — surface de connexion du back-office alignée sur le design
   system V1 (`apps/web/v1/ds/`). Scopé aux surfaces d'accès : `#access`,
   `#invitation` et le dialogue des codes de secours. Le reste de la bibliothèque
   garde sa feuille historique (aucune refonte du back-office). */

/* ── Cartes d'accès ─────────────────────────────────────────────────── */
/* Le back-office fixe la racine à 14 px : les rem du DS y seraient plus petits.
   L'échelle V1 est donc posée en px sur cette surface (20/16/13/11), sans
   toucher à la typographie du reste de la bibliothèque. */
#access, #invitation {
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--w-ink);
}
#access.access-card, #invitation {
  max-width: 460px;
  margin: clamp(24px, 7vh, 64px) auto;
  padding: var(--w-space-9);
  background: var(--w-surface);
  border: var(--w-border-width) solid var(--w-line);
  border-radius: var(--w-radius-panel);
  box-shadow: var(--w-shadow-panel);
}
#access .eyebrow, #invitation .eyebrow {
  margin: 0;
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--w-weight-strong);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w-muted);
}
#access h2, #invitation h2, #invitation h1 {
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin: var(--w-space-2) 0 var(--w-space-3);
}
#access > p, #invitation > p {
  font-size: 13px;
  color: var(--w-muted);
  margin: 0 0 var(--w-space-4);
}
#access form, #invitation form {
  display: grid;
  gap: var(--w-space-5);
  margin: 0;
  padding: 0;
}
#access label, #invitation label {
  display: grid;
  gap: var(--w-space-2);
  font-size: 13px;
  line-height: 18px;
  color: var(--w-ink);
}
#access input, #invitation input {
  min-height: var(--w-target);
  padding: 0 var(--w-space-4);
  font-size: 16px;
  color: var(--w-ink);
  background: var(--w-surface);
  border: var(--w-border-width) solid var(--w-line);
  border-radius: var(--w-radius-control);
}
#access input:focus-visible, #invitation input:focus-visible {
  outline: 2px solid var(--w-focus-ring);
  outline-offset: 2px;
  border-color: var(--w-focus-ring);
}
#access button, #invitation button {
  min-height: var(--w-cta-height);
  padding: 0 var(--w-space-5);
  font-size: 13px;
  color: var(--w-ink);
  background: var(--w-surface);
  border: var(--w-border-width) solid var(--w-line);
  border-radius: var(--w-radius-control);
  cursor: pointer;
}
#access button:focus-visible, #invitation button:focus-visible,
#access summary:focus-visible {
  outline: 2px solid var(--w-focus-ring);
  outline-offset: 2px;
}
#access button.primary, #invitation button.primary {
  color: var(--w-surface);
  background: var(--w-ink);
  border-color: var(--w-ink);
  font-weight: var(--w-weight-strong);
}
#access button.primary:hover:not(:disabled), #invitation button.primary:hover:not(:disabled) { opacity: 0.92; }
#access button:disabled, #invitation button:disabled { opacity: 0.55; cursor: default; }

/* ── Accès de secours (détails) ─────────────────────────────────────── */
#access details { margin-top: var(--w-space-2); }
#access summary {
  display: flex;
  align-items: center;
  min-height: var(--w-target);
  font-size: 13px;
  color: var(--w-ink);
  cursor: pointer;
}
#access details > *:not(summary) { margin-top: var(--w-space-3); }
#access #first-login-help,
#access #access-code-help { font-size: 13px; color: var(--w-muted); }

/* ── Statuts (attente, erreur, aide) ────────────────────────────────── */
#login-status:not(:empty), #invitation-status:not(:empty),
#recovery-status:not(:empty), #legacy-status:not(:empty) {
  font-size: 13px;
  font-weight: var(--w-weight-strong);
  color: var(--w-terracotta);
}

/* ── Enrôlement TOTP ────────────────────────────────────────────────── */
#enrollment ol { margin: var(--w-space-2) 0 0; padding-left: 20px; font-size: 13px; color: var(--w-muted); }
#enrollment-qr {
  display: block;
  width: min(300px, 100%);
  height: auto;
  margin-top: var(--w-space-3);
  padding: var(--w-space-2);
  background: var(--w-surface);
  border: var(--w-border-width) solid var(--w-line);
  border-radius: var(--w-radius-fact);
}
#enrollment-manual { margin-top: var(--w-space-2); }
#enrollment-secret {
  display: inline-block;
  margin-top: var(--w-space-2);
  padding: var(--w-space-2) var(--w-space-3);
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 18px; /* code d'accès — exception codée (docs/design-system.md §5) */
  overflow-wrap: anywhere;
  background: var(--w-context);
  border-radius: var(--w-radius-control);
}

/* ── Codes de secours (dialogue) ────────────────────────────────────── */
#auxiliary .recovery-codes ul { display: grid; gap: var(--w-space-2); margin: var(--w-space-3) 0; padding: 0; list-style: none; }
#auxiliary .recovery-codes code {
  display: block;
  padding: var(--w-space-3);
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
  background: var(--w-context);
  border-radius: var(--w-radius-control);
}

@media (max-width: 520px) {
  #access.access-card, #invitation { margin: var(--w-space-5) auto; padding: var(--w-space-7); }
}
