/* Two-factor authentication (sign-in & setup) */

.tfa-form {
  margin-top: 0.25rem;
}

.tfa-field {
  margin-bottom: 1.1rem;
}

.tfa-field-code {
  margin-bottom: 0.5rem;
}

.tfa-field-remember {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tfa-field-remember .form-check-input {
  margin-top: 0.2rem;
}

.tfa-field-remember .form-check-label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  line-height: 1.4;
}

.tfa-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bs-body-color);
  margin-bottom: 0.4rem;
}

.tfa-field .form-control {
  border-radius: 0.625rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.9375rem;
  border-color: rgba(var(--inverse-color-rgb), 0.14);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tfa-field .form-control:focus {
  border-color: rgba(var(--bs-primary-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.tfa-pw-wrap {
  position: relative;
}

.tfa-pw-wrap .form-control {
  padding-right: 2.75rem;
}

.tfa-pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  padding: 0.25rem;
  line-height: 1;
  border-radius: 0.35rem;
}

.tfa-pw-toggle:hover {
  color: var(--bs-body-color);
}

.tfa-code-input {
  font-size: 1.5rem !important;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-align: center;
  padding: 0.8rem 1rem !important;
  border-radius: 0.625rem !important;
  max-width: 100%;
  -moz-appearance: textfield;
}

.tfa-code-input::-webkit-outer-spin-button,
.tfa-code-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.tfa-code-input::placeholder {
  letter-spacing: 0.18em;
  font-weight: 400;
  color: rgba(var(--inverse-color-rgb), 0.3);
}

.tfa-qr-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid rgba(var(--inverse-color-rgb), 0.08);
  margin-bottom: 1.25rem;
}

.tfa-qr-card img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.tfa-method-list {
  display: grid;
  gap: 0.5rem;
}

.tfa-method-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(var(--inverse-color-rgb), 0.12);
  background: #fff;
  cursor: pointer;
  margin: 0;
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tfa-method-option:has(input:checked) {
  border-color: rgba(var(--bs-primary-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.tfa-method-option input {
  flex-shrink: 0;
  margin: 0;
}

.tfa-actions {
  margin-top: 0.5rem;
}

.tfa-submit {
  font-weight: 600;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  letter-spacing: 0.01em;
}

.tfa-secondary-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin-top: 1.25rem;
  padding-top: 0;
}

.tfa-text-action {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
}

.tfa-text-action:hover {
  color: var(--bs-primary);
  text-decoration: underline;
}

.auth-surface-body .alert {
  font-size: 0.875rem;
}

ul.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--bs-danger);
}

ul.errorlist:empty {
  display: none;
}

.auth-surface-body ul.errorlist:not(:has(li)) {
  display: none;
}

.tfa-field-errors {
  font-size: 0.8125rem;
}

.tfa-status-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(var(--bs-primary-rgb), 0.05);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.1);
}

.tfa-status-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.1);
  font-size: 1rem;
}

.tfa-secondary-nav .tfa-text-action.text-danger:hover {
  color: var(--bs-danger) !important;
}

.tfa-backup-list {
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(var(--inverse-color-rgb), 0.03);
  border: 1px solid rgba(var(--inverse-color-rgb), 0.08);
}

.tfa-backup-list li {
  padding: 0.35rem 0;
  font-size: 1rem;
  letter-spacing: 0.06em;
}

/* Profile / legacy helpers */
.tfa-intro-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.08);
  margin-bottom: 1rem;
}
