/* Écrans de compte (registre §67) : connexion, Mon compte, gestion des comptes. */
.auth-dialog { width: min(440px, calc(100% - 30px)); max-height: calc(100dvh - 30px); overflow: auto; }
.auth-dialog::backdrop { background: var(--navy); backdrop-filter: none; }
.auth-panel { padding: 28px 26px 22px; }
.auth-panel form { padding: 0; }
.auth-logo { display: block; height: 44px; width: auto; margin-bottom: 14px; }
.auth-panel h2, .account-panel h3 { margin: 0 0 14px; color: var(--navy); }
.account-panel h3 { font-size: 16px; }
.account-panel h4 { margin: 18px 0 10px; color: var(--navy); font-size: 14px; }
.auth-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.account-dialog { width: min(680px, calc(100% - 30px)); max-height: calc(100dvh - 30px); }
.account-panel { padding: 26px; }
.account-panel form, .account-panel section { padding: 0; margin-bottom: 22px; }
.account-panel section { border-top: 1px solid var(--line); padding-top: 18px; }
.auth-links { margin: 12px 0 0; }
.auth-link { border: 0; background: none; padding: 8px 0; min-height: 44px; color: var(--blue, #2563eb); font-family: inherit; text-decoration: underline; cursor: pointer; }
.auth-error, .auth-ok, .auth-secret { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; }
.auth-error { background: var(--red-soft); color: #9b2c2c; }
.auth-ok { background: var(--green-soft); color: #14684b; }
.auth-secret { background: var(--amber-soft); color: var(--navy); }
.auth-secret code { font: 700 16px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; user-select: all; }
.auth-error[hidden], .auth-ok[hidden], .auth-secret[hidden], .auth-link[hidden] { display: none; }
.accounts-list { display: grid; gap: 10px; margin-top: 12px; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.account-row.inactive { opacity: .6; }
.account-who { display: grid; min-width: 0; }
.account-who small { color: var(--muted); overflow-wrap: anywhere; }
.account-row select { border: 1px solid var(--p-bordure-2); border-radius: 7px; padding: 8px; font-family: inherit; }
.account-button { display: block; width: 100%; margin: 0 0 8px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.account-button[hidden], .version[hidden] { display: none; }
a.version { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
a.more-item { text-decoration: none; color: inherit; }
@media (max-width: 700px) {
  .auth-dialog, .account-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .account-row { grid-template-columns: 1fr 1fr; }
  .account-who { grid-column: 1 / -1; }
}

/* Écran réduit d'un compte sans droit de lecture (salarié, registre §70) */
body.restricted { overflow: hidden; }
.restricted-home { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: var(--navy); overflow: auto; }
.restricted-home .auth-panel { width: min(440px, 100%); background: var(--surface, var(--p-blanc)); border-radius: 12px; }
.restricted-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Double authentification (registre §81) */
.twofa-qr { display: block; margin: 12px auto; background: var(--p-blanc); padding: 8px; border-radius: 8px; }
.twofa-codes { font: 700 16px ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.8; columns: 2; margin: 12px 0 0; user-select: all; }
#twofa-secret { font: 700 14px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; user-select: all; }

/* Renommer un compte (V22) */
.account-rename { display: grid; gap: 8px; }
.account-rename input { border: 1px solid var(--p-bordure-2); border-radius: 7px; padding: 8px; font-family: inherit; min-width: 0; }
.account-rename-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* V288 : la case « Compte de remplacement » (V114, §257) se touche au doigt : ligne de 44 px, case de 22 px. */
.account-remplacant, .account-droit { display: inline-flex; align-items: center; gap: 10px; }
@media (pointer: coarse), (max-width: 900px) {
  .account-remplacant, .account-droit { display: flex; min-height: 44px; }
  .account-remplacant input, .account-droit input { width: 22px; height: 22px; }
}
/* V166 (§313) : ce que règlent « Peut déroger » et « Peut affecter les équipes », dit une fois en tête de la liste. */
.account-droits-aide { margin: 4px 0 10px; font-size: 14px; }

/* V138 (§282) : « Créer plusieurs comptes », sous « Ajouter un compte ». */
.accounts-batch { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.accounts-batch summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.accounts-batch[open] { padding-bottom: 14px; }
.accounts-batch label { display: grid; gap: 4px; margin-top: 10px; }
.accounts-batch textarea, .accounts-batch input[data-lot-commun] { font-size: 16px; }
.accounts-batch .lot-code { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; }
.accounts-batch .lot-choix { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 0; }
.accounts-batch .lot-table { overflow-x: auto; margin-top: 12px; }
.accounts-batch table { width: 100%; border-collapse: collapse; font-size: 14px; }
.accounts-batch th, .accounts-batch td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.accounts-batch tr[data-lot-ligne="erreur"] td:last-child, .accounts-batch tr[data-lot-resultat="erreur"] td:last-child { color: var(--red, var(--p-rouge-fonce)); font-weight: 600; }
.accounts-batch tr[data-lot-ligne="existe"] td:last-child { color: var(--muted, #56687a); }
