/* Shared styling for all two-factor setup + verification screens.
   Scoped via `.tf-*` class prefix — safe to load globally alongside _LoginLayout.
   Design language: Rippling-inspired. Generous padding, soft typography,
   subtle borders, low-opacity surfaces, no Font Awesome clutter. */

.tf-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 0 0 1px rgba(15, 23, 42, .04);
}

/* Profile-context pill sitting at the top of the card. Confirms the user the
   flow is happening for. Wrapper centers it; pill itself is shrink-wrapped. */
.tf-profile-pill-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.tf-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 18px 5px 5px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  max-width: 320px;
}
.tf-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0;
}
.tf-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tf-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Back link at top-left of card. Ghost text-link styling — no border, no
   background by default, just a subtle hover. Sits flush against the card's
   left padding using a negative margin so it doesn't visually float in. */
.tf-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: -6px 0 12px -10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.tf-back:hover,
.tf-back:focus {
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
  outline: none;
}
.tf-back-arrow {
  font-size: 16px;
  line-height: 1;
  margin-top: -1px;
}

.tf-title {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.2;
  text-align: center;
}

.tf-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0 0 28px;
  text-align: center;
  line-height: 1.5;
}

/* Radio-option cards on the method picker. */
.tf-radio-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.tf-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.tf-radio-card:hover { border-color: #cbd5e1; background: #f8fafc; }
.tf-radio-card input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #2563eb;
  width: 16px;
  height: 16px;
}
.tf-radio-card:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.tf-radio-name { font-size: 15px; font-weight: 600; color: #0f172a; line-height: 1.4; }
.tf-radio-desc { font-size: 14px; color: #64748b; line-height: 1.4; margin-top: 2px; }

/* Form fields. */
.tf-field-group { margin-bottom: 20px; }
.tf-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 8px;
}
.tf-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tf-input::placeholder { color: #94a3b8; }
.tf-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.tf-input-code {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 8px;
  font-variant-numeric: tabular-nums;
}
.tf-input-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  letter-spacing: .5px;
}

/* Buttons. */
.tf-btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.tf-btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.tf-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.tf-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tf-btn-secondary:hover:not(:disabled) { background: #f8fafc; border-color: #94a3b8; }

/* Inline messages. */
.tf-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 6px;
  display: block;
}
.tf-hint {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

/* QR code container (Authenticator setup). */
.tf-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.tf-qr-box {
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.tf-qr-box img { display: block; }

/* Manual-key disclosure. */
.tf-details {
  margin-bottom: 24px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}
.tf-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  list-style: none;
}
.tf-details summary::-webkit-details-marker { display: none; }
.tf-details summary::before {
  content: "▸ ";
  display: inline-block;
  color: #64748b;
  transition: transform .15s ease;
}
.tf-details[open] summary::before { content: "▾ "; }
.tf-key-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.tf-key-row .tf-input { flex: 1; }

/* ----------------------------------------------------------------------------
   Profile "Change 2FA method" modal styles.
   These run inside the app's main layout (not _LoginLayout), so we can't rely
   on .tf-card here — the modal frame is the surface. .tf-modal-card adds the
   inner padding + scopes the modal's own rules without leaking onto the rest
   of the page.
   ---------------------------------------------------------------------------- */
.tf-modal-card { padding: 8px 12px 16px; }

/* Resend link row under the verify button. */
.tf-resend-row {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #64748b;
}
.tf-resend-row a {
  color: #2563eb;
  cursor: pointer;
}
.tf-resend-row a.disabled {
  color: #94a3b8;
  pointer-events: none;
}

/* Destructive primary button (Remove 2FA confirmation). Mirrors .tf-btn-primary's
   full-width shape — just swaps blue for red. */
.tf-btn-danger {
  width: 100%;
  padding: 12px 16px;
  background: #dc2626;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.tf-btn-danger:hover:not(:disabled) { background: #b91c1c; }
.tf-btn-danger:disabled { opacity: .6; cursor: not-allowed; }

/* TOTP shared-key display under the QR code. */
.tf-shared-key { text-align: center; margin-bottom: 20px; }
.tf-shared-key-hint { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.tf-shared-key-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 6px;
  color: #0f172a;
  user-select: all;
}

/* Fixed-size QR image variant for the change-method modal. The existing
   .tf-qr-box (login flow) doesn't constrain the image size — the modal needs
   a predictable footprint. */
.tf-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  border: 1px solid #e2e8f0;
}
