/* TOTP y recuperación: compartido por cuenta personal, profesional y acceso. */
.mfa-progress, .mfa-backup-manager, .mfa-backup-panel, .mfa-notice, .mfa-dialog, .mfa-recovery-help {
  --mfa-ink: #142b47;
  --mfa-muted: #52647b;
  --mfa-blue: #164e91;
  --mfa-border: #cbd9e8;
  box-sizing: border-box;
  color: var(--mfa-ink);
  font-family: inherit;
}
#btnTotpEnroll[hidden], .mfa-progress[hidden], .mfa-backup-manager[hidden], .mfa-backup-panel[hidden], .mfa-notice[hidden], .mfa-dialog [hidden] { display: none !important; }
.mfa-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 20px 0; padding: 0; counter-reset: mfa-step; }
.mfa-progress li { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--mfa-border); border-radius: 12px; background: #f5f8fc; font-size: 13px; line-height: 1.4; font-weight: 600; }
.mfa-progress li::before { counter-increment: mfa-step; content: counter(mfa-step); flex: 0 0 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #e1eaf4; color: #164e91; }
.mfa-progress li.is-current { border-color: #367abd; background: #edf5ff; }
.mfa-progress li.is-current::before { background: #164e91; color: #fff; }
.mfa-progress li.is-complete::before { content: '✓'; background: #d6f0e6; color: #136047; }
.mfa-notice { margin: 18px 0; padding: 15px 18px; border: 1px solid #afd9c7; border-radius: 12px; background: #eef9f3; color: #165c42; font-size: 14px; line-height: 1.6; }
.mfa-notice[data-tone='info'] { color: #184e80; background: #edf5ff; border-color: #bfd8f1; }
.mfa-notice[data-tone='warning'] { color: #794b10; background: #fff8e9; border-color: #e5c98d; }
.mfa-notice[data-tone='error'] { color: #972b2b; background: #fff1f1; border-color: #e7bbbb; }
.mfa-backup-manager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 24px; padding: 20px; border: 1px solid var(--mfa-border); border-radius: 14px; background: #f6f9fd; }
.mfa-backup-manager > div { flex: 1 1 260px; min-width: 0; }
.mfa-backup-manager strong { color: var(--mfa-ink); font-size: 16px; }
.mfa-backup-manager p { margin: 7px 0 0; color: var(--mfa-muted); font-size: 14px; line-height: 1.6; }
.mfa-backup-manager[data-tone='warning'] { background: #fff8e9; border-color: #e5c98d; }
.mfa-backup-manager[data-tone='warning'] p { color: #794b10; }
.mfa-backup-panel { margin-top: 20px; padding: clamp(18px, 4vw, 28px); border: 2px solid #2d6eb0; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px #1438630d; }
.mfa-backup-panel h4 { margin: 5px 0 10px; color: var(--mfa-ink); font-size: 22px; line-height: 1.3; }
.mfa-backup-panel p { color: var(--mfa-muted); font-size: 14px; line-height: 1.6; }
.mfa-eyebrow { margin: 0; color: #164e91 !important; font-size: 12px !important; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.mfa-backup-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 22px 0; padding: 0; }
.mfa-backup-list li { min-width: 0; padding: 13px 8px; border: 1px solid #cbd9e8; border-radius: 9px; background: #f5f8fc; text-align: center; }
.mfa-backup-list code { font: 600 16px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; color: #173f6d; letter-spacing: .04em; user-select: all; }
.mfa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.mfa-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 10px 16px; border: 1px solid #a9c1da; border-radius: 9px; background: #fff; color: #174a7f; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; cursor: pointer; text-align: center; white-space: normal; }
.mfa-button:hover:not(:disabled) { background: #edf4fc; }
.mfa-button--primary { color: #fff; background: #164e91; border-color: #164e91; }
.mfa-button--primary:hover:not(:disabled) { background: #0f3d75; }
.mfa-button--danger { color: #fff; background: #a33131; border-color: #a33131; }
.mfa-button--danger:hover:not(:disabled) { background: #822626; }
.mfa-button:disabled { opacity: .55; cursor: not-allowed; }
.mfa-button:focus-visible, .mfa-save-check:focus-within, .mfa-dialog input:focus-visible, .mfa-recovery-help summary:focus-visible, .mfa-backup-panel:focus-visible, .mfa-notice:focus-visible { outline: 3px solid #3a85ce; outline-offset: 3px; }
.mfa-save-check { display: flex !important; align-items: flex-start; gap: 12px; margin: 22px 0 14px; padding: 14px; border-radius: 10px; background: #edf5ff; cursor: pointer; color: #173f6d; font-size: 14px; line-height: 1.6; }
.mfa-save-check input[type='checkbox'] { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; accent-color: #164e91; }
.mfa-save-check span { color: inherit; font-size: inherit; }
#backupCodesSaveFeedback { margin: 12px 0 0; color: #174a7f; }
#backupCodesSaveFeedback:empty { display: none; }
.mfa-dialog { width: min(470px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid #bdcde0; border-radius: 18px; padding: clamp(20px, 5vw, 30px); background: #fff; box-shadow: 0 20px 80px #0d24334d; }
.mfa-dialog::backdrop { background: #102b4c99; }
.mfa-dialog h2 { margin: 10px 0 12px; font-size: 23px; line-height: 1.3; color: #142b47; }
.mfa-dialog p { font-size: 14px; line-height: 1.6; }
.mfa-dialog label { display: block; margin: 18px 0 8px; color: #142b47; font-size: 14px; font-weight: 600; }
.mfa-dialog input { box-sizing: border-box; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #9bb6d1; border-radius: 9px; background: #fff; color: #142b47; font: 24px/1.4 ui-monospace, monospace; letter-spacing: .25em; }
.mfa-dialog .mfa-dialog-error { color: #972b2b; }
.mfa-dialog .mfa-dialog-error:empty { display: none; }
.mfa-dialog .mfa-actions { justify-content: flex-end; }
.mfa-recovery-help { margin-top: 18px; border-top: 1px solid #d7e1ec; padding-top: 10px; font-size: 14px; }
.mfa-recovery-help summary { min-height: 44px; align-content: center; cursor: pointer; color: #1c5287; font-weight: 600; line-height: 1.5; }
.mfa-recovery-help p { color: #52647b; font-size: 14px; line-height: 1.6; margin: 10px 0; }
.mfa-recovery-help a { color: #164e91; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
#totpSetupPanel { scroll-margin-top: 100px; }
#totpSetupPanel input { min-height: 44px; box-sizing: border-box; max-width: 100%; }
#totpSetupPanel summary { min-height: 44px; align-content: center; color: #1c5287 !important; }
#totpSetupPanel #totpCode { font-size: 22px; letter-spacing: .2em; }
#totpSetupPanel #totpManualKey { font-family: ui-monospace, monospace; font-size: 14px; letter-spacing: .04em; }
#totpSetupPanel button { min-height: 44px; }
@media (max-width: 600px) {
  .mfa-progress { grid-template-columns: 1fr; gap: 6px; }
  .mfa-progress li { padding: 9px 12px; }
  .mfa-backup-list { grid-template-columns: 1fr; gap: 8px; }
  .mfa-backup-manager > .mfa-button, .mfa-backup-panel .mfa-button { width: 100%; }
  .mfa-dialog .mfa-actions { flex-direction: column-reverse; align-items: stretch; }
  .mfa-dialog .mfa-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .mfa-dialog, .mfa-button, .mfa-backup-panel { animation: none; transition: none; scroll-behavior: auto; }
}
