/* ── La double authentification, écrans du CRM (11/11) ─────────────────────
   L'étape de la connexion et l'activation reprennent l'écran de connexion
   (fond nuit, carte claire) : on y est encore, le mot de passe vient d'être
   tapé. La section des Paramètres suit les jetons du thème (clair, sombre). */

.df-ecran {
  position: fixed; inset: 0; z-index: 10001;
  background: linear-gradient(135deg, #0d2640 0%, #143352 60%, #1a4060 100%);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
}
body.df-ouvert { overflow: hidden; }
.df-carte {
  background: #ffffff; color: #0d2640; border-radius: 16px; width: 100%; max-width: 400px;
  margin: auto 0; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  font-size: 15px; line-height: 1.5;
}
.df-carte--large { max-width: 460px; }
.df-form { display: flex; flex-direction: column; gap: 14px; }
.df-surtitre { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #4a6585; }
.df-h2 { margin: 0; font-size: 1.3rem; font-weight: 700; color: #0d2640; outline: none; }
.df-texte { margin: 0; color: #334155; }
.df-aide { display: block; margin: 0; font-size: 13px; color: #546478; }
.df-alerte { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fef2f2; color: #9f1c1c; font-size: 14px; }
.df-alerte--ok { background: #ecfdf3; color: #14653b; }
.df-champ { display: flex; flex-direction: column; gap: 6px; }
.df-champ label { font-size: 14px; font-weight: 600; color: #0d2640; }
.df-saisie {
  border: 1.5px solid #c9d3df; border-radius: 8px; padding: 10px 12px; min-height: 48px;
  font-size: 16px; color: #0d2640; background: #ffffff; width: 100%; box-sizing: border-box;
}
.df-saisie:focus { outline: none; border-color: #4F63F5; box-shadow: 0 0 0 3px rgba(79, 99, 245, .25); }
.df-saisie--code { font-size: 24px; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; }
.df-saisie--secours { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.df-case { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.df-case input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: #0d2640; }
.df-case strong { display: block; color: #0d2640; }
.df-btn {
  min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1.5px solid #0d2640; background: #ffffff;
  color: #0d2640; font-weight: 600; font-size: 15px; cursor: pointer;
}
.df-btn--plein { background: #0d2640; color: #ffffff; }
.df-btn--plein:hover:not([disabled]) { background: #1a3a5c; }
.df-btn:focus-visible, .df-lien:focus-visible, .df-case input:focus-visible { outline: 3px solid #4F63F5; outline-offset: 2px; }
.df-btn[disabled] { opacity: .5; cursor: not-allowed; }
.df-liens { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.df-lien {
  background: none; border: 0; padding: 8px 2px; min-height: 40px; color: #2855D4; font-size: 14px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.df-etapes { margin: 0; padding-left: 22px; color: #334155; font-size: 14px; display: grid; gap: 4px; }
.df-qr-zone { display: flex; justify-content: center; }
.df-qr { width: 208px; height: 208px; max-width: 100%; border: 1px solid #e2e8f0; border-radius: 6px; background: #ffffff; }
.df-cle-zone { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.df-cle {
  display: block; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; letter-spacing: .05em;
  background: #f1f5f9; color: #0d2640; border-radius: 6px; padding: 8px 10px; word-break: break-word; user-select: all;
}
.df-codes {
  margin: 0; padding: 12px 12px 12px 36px; background: #f1f5f9; border-radius: 8px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px;
}
.df-codes code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 15px; color: #0d2640; letter-spacing: .03em; }
.df-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.df-boutons .df-btn { flex: 1 1 120px; }
.df-imprime-seul { display: none; }
.df-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 420px) {
  .df-ecran { padding: 16px; }
  .df-carte { padding: 22px 16px; }
  .df-codes { grid-template-columns: 1fr; }
}

/* Imprimer : les codes seuls, rien du CRM derrière. */
@media print {
  body.df-impression > *:not(#df-ecran) { display: none !important; }
  body.df-impression .df-ecran { position: static; background: none; padding: 0; overflow: visible; }
  body.df-impression .df-carte { box-shadow: none; max-width: none; padding: 0; }
  body.df-impression .df-non-imprime { display: none !important; }
  body.df-impression .df-imprime-seul { display: block; }
  body.df-impression .df-codes { background: none; }
}

/* ── Paramètres › « Double authentification » (thème du CRM) ── */
.df-section .df-bloc { padding: 12px 0; border-top: 1px solid var(--border, #e4e4e7); }
.df-section .df-bloc:first-of-type { border-top: 0; padding-top: 0; }
.df-h4 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--text, #0a0a0a); }
.df-pastille { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border, #e4e4e7); }
.df-pastille--ok { color: var(--success, #10B981); }
.df-pastille--non { color: var(--text-muted, #52525b); }
.df-conseil { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--warning, #f59e0b); background: var(--bg-soft, #f4f4f5); color: var(--text, #0a0a0a); font-size: 13px; }
.df-boutons-ligne { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.df-allumer { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.df-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.df-ligne input { flex: 1 1 140px; min-height: 40px; }

/* ── Comptes : la pastille « Double auth. » ── */
.badge.cp-df { background: var(--cp-vert-f, #e3f3ea); color: var(--cp-vert-t, #14653b); }

/* « hidden » l'emporte sur l'affichage des blocs de l'écran (le champ du code
   de secours, l'alerte vide) : sans cela, display:flex le montrait. */
.df-ecran [hidden] { display: none !important; }
.df-section[hidden] { display: none !important; }
