/* AnomicFlip — 2FA popups (setup, backup codes, remove) */
.tf-overlay, .tf-overlay * { box-sizing: border-box; }
.tf-overlay {
  position: fixed; inset: 0; z-index: 1000; padding: 16px;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 10, 12, .72); backdrop-filter: blur(3px);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #fff;
}
.tf-overlay.open { display: flex; animation: tf-fade .18s ease-out; }
@keyframes tf-fade { from { opacity: 0 } to { opacity: 1 } }

.tf-modal {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 40px 36px 34px; background: #1e2125; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.tf-close {
  position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: #262a2f; color: #e6e8eb; cursor: pointer; display: grid; place-items: center;
}
.tf-close:hover { background: #30343b; }

.tf-badge { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: rgba(63,214,143,.12); color: #3fd68f; margin-bottom: 18px; }
.tf-badge.warn { background: rgba(255,92,108,.12); color: #ff5c6c; }
.tf-title { margin: 0; font-size: 30px; font-weight: 800; padding-right: 56px; }
.tf-sub { margin: 10px 0 0; font-size: 17px; line-height: 1.5; color: #9a9ea6; }
.tf-divider { height: 1px; background: #2e3238; margin: 26px 0; }

/* setup */
.tf-scan { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.tf-qr { width: 200px; height: 200px; padding: 10px; border-radius: 14px; background: #fff; display: grid; place-items: center; }
.tf-qr img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.tf-qr .tf-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d7dbe0; border-right-color: transparent; animation: tf-r .8s linear infinite; }
@keyframes tf-r { to { transform: rotate(360deg) } }
.tf-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.tf-steps li { counter-increment: s; display: flex; gap: 12px; font-size: 16px; line-height: 1.45; color: #a7abb2; }
.tf-steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(63,214,143,.12); color: #3fd68f; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.tf-steps b { color: #fff; }
.tf-key { margin-top: 18px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 10px; background: #2a2d33; }
.tf-key code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 600 15px/1.4 ui-monospace, Consolas, monospace; color: #e9ebee; letter-spacing: .5px; }
.tf-label { display: block; margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #a7abb2; }
.tf-code {
  width: 100%; height: 76px; border-radius: 10px; border: 2px solid transparent; background: #2a2d33; outline: none;
  color: #fff; text-align: center; font: 700 34px ui-monospace, Consolas, monospace; letter-spacing: 14px; padding-left: 14px;
}
.tf-code:focus { border-color: #3fd68f; }
.tf-code.error { border-color: #ff5c6c; }
.tf-code::placeholder { color: #4a4f57; }
.tf-err { margin-top: 12px; font-size: 15px; color: #ff8b97; }
.tf-err:empty { display: none; }

/* buttons */
.tf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
  background: #2a2d33; color: #fff; font: 700 17px 'Archivo', system-ui, sans-serif; transition: background .15s, opacity .15s;
}
.tf-btn:hover:not(:disabled) { background: #33373e; }
.tf-btn.green { background: #3fbf7f; }
.tf-btn.green:hover:not(:disabled) { background: #46cc8a; }
.tf-btn.full { width: 100%; height: 66px; margin-top: 20px; font-size: 19px; }
.tf-btn:disabled { opacity: .45; cursor: not-allowed; }
.tf-btn.sm { height: 40px; padding: 0 14px; font-size: 14px; background: #33373e; }
.tf-btn:focus-visible, .tf-close:focus-visible { outline: 2px solid #3fd68f; outline-offset: 2px; }
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }

/* backup codes */
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tf-codes span {
  display: flex; align-items: center; justify-content: center; height: 54px; border-radius: 10px; background: #2a2d33;
  font: 700 19px ui-monospace, Consolas, monospace; letter-spacing: 2px; color: #e9ebee; user-select: all;
}
.tf-codes span.used { color: #5f646c; text-decoration: line-through; user-select: none; }
.tf-tip { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: rgba(245,200,74,.08); border: 1px solid rgba(245,200,74,.25); font-size: 15px; line-height: 1.45; color: #c9ccd1; }
.tf-tip b { color: #f5c84a; }

@media (max-width: 600px) {
  .tf-modal { padding: 30px 20px 24px; }
  .tf-title { font-size: 24px; }
  .tf-scan { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .tf-code { font-size: 28px; letter-spacing: 10px; }
  .tf-codes span { font-size: 16px; }
  .tf-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tf-overlay.open { animation: none; } }
