/* 2FA — inloggning och inställningar */
.login-2fa-panel {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.login-2fa-panel.hidden { display: none !important; }
#loginForm.hidden { display: none !important; }

.login-2fa-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.login-2fa-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.35rem;
}
.login-2fa-sub {
  color: #64748b;
  font-size: 0.9375rem;
  margin: 0 0 1.25rem;
  line-height: 1.45;
}
.login-2fa-digits {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.login-2fa-digit {
  width: 2.75rem;
  height: 3.25rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-2fa-digit:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.login-2fa-recovery {
  width: 100%;
  max-width: 16rem;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.login-2fa-recovery.hidden { display: none !important; }
.login-2fa-remember {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 1rem;
  cursor: pointer;
}
.login-2fa-remember input { width: 1rem; height: 1rem; accent-color: #6366f1; }
.login-2fa-error {
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.login-2fa-error.hidden { display: none !important; }
.login-2fa-submit {
  width: 100%;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.login-2fa-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.login-2fa-link {
  display: block;
  background: none;
  border: none;
  color: #6366f1;
  font-size: 0.8125rem;
  cursor: pointer;
  margin: 0.35rem auto;
  text-decoration: underline;
}
.login-2fa-back { color: #64748b; }

/* Inställningar */
.tfa-card {
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--bg-secondary, #f8fafc);
}
.tfa-card--promo {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.tfa-promo-icon { font-size: 2rem; flex-shrink: 0; }
.tfa-card h4 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.tfa-muted { color: var(--text-secondary, #64748b); font-size: 0.9rem; margin: 0.25rem 0; }
.tfa-benefits {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-secondary, #475569);
  font-size: 0.875rem;
}
.tfa-benefits li { margin-bottom: 0.25rem; }
.tfa-btn { margin-top: 0.25rem; }
.tfa-setup { text-align: center; }
.tfa-qr {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin: 0.75rem auto;
  display: block;
}
.tfa-code-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}
.tfa-code-input {
  max-width: 10rem;
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
}
.tfa-link-btn {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.875rem;
}
.tfa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ecfdf5;
  color: #047857;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.tfa-devices { margin: 1rem 0; text-align: left; }
.tfa-devices h5 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.tfa-devices ul { list-style: none; padding: 0; margin: 0; }
.tfa-device {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  font-size: 0.875rem;
}
.tfa-recovery-codes {
  background: #1e293b;
  color: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
}
.tfa-loading { text-align: center; padding: 2rem; color: #64748b; }
.tfa-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: tfa-spin 0.7s linear infinite;
  margin: 0 auto 0.75rem;
}
@keyframes tfa-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .login-2fa-digit { width: 2.35rem; height: 2.85rem; font-size: 1.25rem; }
  .login-2fa-digits { gap: 0.35rem; }
  .tfa-card--promo { flex-direction: column; }
}

.login-2fa-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366f1;
  margin: 0 0 0.25rem;
}
.login-2fa-remember-hint { color: #94a3b8; font-weight: 400; }
.login-2fa-submit.hidden { display: none !important; }
#loginModal .login-modal-footer.hidden { display: none !important; }

/* Kompakt inställningsrad */
.tfa-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 10px;
  background: #fff;
}
.tfa-compact--on { border-color: #bbf7d0; background: #f0fdf4; }
.tfa-compact-main { display: flex; flex-direction: column; gap: 0.15rem; }
.tfa-compact-label { font-size: 0.8125rem; color: #64748b; }
.tfa-compact-value { font-weight: 600; font-size: 0.9375rem; color: #334155; }
.tfa-compact-value--on { color: #047857; }
.tfa-compact-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
  white-space: nowrap;
}
.tfa-compact-btn:hover { background: #f8fafc; }
.tfa-enabled-details { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed #e2e8f0; }
.tfa-lead { margin-bottom: 0.75rem !important; }
.tfa-dismiss-setup { display: block; margin: 0.75rem auto 0; }
.tfa-setup-actions { display: flex; gap: 0.75rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.tfa-disable-form { margin-top: 0.5rem; }
.tfa-inline-confirm { display: inline-flex; gap: 0.5rem; align-items: center; }
.tfa-device-list { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.tfa-recovery-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

/* Diskret dashboard-tips */
.hdh-2fa-nudge {
  margin-bottom: 1rem;
  animation: hdhNudgeIn 0.35s ease;
}
.hdh-2fa-nudge-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  font-size: 0.875rem;
  color: #475569;
}
.hdh-2fa-nudge-text strong { color: #334155; font-weight: 600; }
.hdh-2fa-nudge-actions { display: flex; gap: 0.5rem; align-items: center; }
.hdh-2fa-nudge-link {
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}
.hdh-2fa-nudge-dismiss {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
}
@keyframes hdhNudgeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
