/* Shared exam/auth dialogs */
.tf-dlg {
  --tf-teal: #00a8c0;
  --tf-teal-dark: #0090a6;
  --tf-teal-soft: #e6f7fa;
  --tf-teal-mid: #b8e8ef;
  --tf-ink: #1f2a37;
  --tf-muted: #6b7280;
  --tf-line: #e5e7eb;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}
.tf-dlg--modal {
  position: relative;
  inset: auto;
  padding: 0;
  z-index: 1;
}
.tf-dlg__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}
.tf-dlg__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 1.75rem 1.55rem 1.45rem;
  animation: tfDlgIn 0.22s ease-out;
}
.tf-dlg__panel--sm { max-width: 380px; }
@keyframes tfDlgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.tf-dlg__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--tf-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
}
.tf-dlg__close:hover { background: #e5e7eb; color: var(--tf-ink); }
.tf-dlg__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.95rem;
  background: var(--tf-teal-soft);
  color: var(--tf-teal-dark);
  font-size: 1.45rem;
}
.tf-dlg__icon.is-success { background: #e8f8ef; color: #15803d; }
.tf-dlg__icon.is-warn { background: #fff7ed; color: #c2410c; }
.tf-dlg__icon.is-info { background: var(--tf-teal-soft); color: var(--tf-teal-dark); }
.tf-dlg__title {
  margin: 0 0 0.45rem;
  text-align: center;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--tf-ink);
}
.tf-dlg__desc {
  margin: 0 0 1.15rem;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--tf-muted);
}
.tf-dlg__desc strong { color: var(--tf-ink); font-weight: 700; }
.tf-dlg__account {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.05rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #e6f7fa 0%, #f0fbfc 100%);
  border: 1px solid var(--tf-teal-mid);
}
.tf-dlg__account-meta { min-width: 0; }
.tf-dlg__account-meta em {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tf-teal-dark);
  margin-bottom: 0.15rem;
}
.tf-dlg__account-meta strong {
  display: block;
  color: var(--tf-ink);
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-dlg__account-meta span {
  display: block;
  color: #0f5f6c;
  font-size: 0.8rem;
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-dlg__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tf-teal);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(0, 168, 192, 0.28);
}
.tf-dlg__guest,
.tf-dlg__form,
.tf-dlg__stack,
.tf-dlg__social {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.tf-dlg__social { margin-bottom: 0.35rem; }
.tf-dlg__social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
  width: 100%;
  padding: 0 1rem;
  border-radius: 11px;
  border: 1.5px solid var(--tf-line);
  background: #fff;
  color: var(--tf-ink);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
}
.tf-dlg__social-btn:hover:not(:disabled) {
  border-color: #d1d5db;
  background: #f9fafb;
}
.tf-dlg__social-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tf-dlg__field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  text-align: left;
}
.tf-dlg__field span { font-size: 0.8rem; font-weight: 700; color: var(--tf-ink); }
.tf-dlg__field:has(input[required]) > span::after {
  content: " *";
  color: #dc2626;
  font-weight: 800;
}
.tf-dlg__req { color: #dc2626; font-weight: 800; }
.tf-dlg__field input {
  height: 44px;
  border: 1.5px solid var(--tf-line);
  border-radius: 11px;
  padding: 0 0.9rem;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--tf-ink);
  background: #fafbfc;
  outline: none !important;
  box-shadow: none !important;
}
.tf-dlg__field input::placeholder { color: #9ca3af; }
.tf-dlg__field input:focus { border-color: var(--tf-teal); background: #fff; }
.tf-dlg__error {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
  text-align: center;
}
.tf-dlg__actions {
  display: flex;
  gap: 0.65rem;
  justify-content: stretch;
  margin-top: 0.35rem;
}
.tf-dlg__actions > .tf-dlg__btn { flex: 1; }
.tf-dlg__actions--stack { flex-direction: column; }
.tf-dlg__actions--stack > .tf-dlg__btn { flex: none; width: 100%; }
.tf-dlg__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0;
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 600;
}
.tf-dlg__divider::before,
.tf-dlg__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tf-line);
}
.tf-dlg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}
.tf-dlg__btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tf-dlg__btn--primary {
  background: var(--tf-teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 168, 192, 0.22);
}
.tf-dlg__btn--primary:hover:not(:disabled) { background: var(--tf-teal-dark); }
.tf-dlg__btn--soft {
  background: var(--tf-teal-soft);
  color: var(--tf-teal-dark);
  border-color: var(--tf-teal-mid);
}
.tf-dlg__btn--ghost {
  background: #fff;
  color: var(--tf-muted);
  border-color: var(--tf-line);
}
.tf-dlg__btn--ghost:hover:not(:disabled) {
  color: var(--tf-ink);
  border-color: #d1d5db;
  background: #f9fafb;
}
.tf-dlg__btn--block { width: 100%; }
.tf-dlg__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.28rem;
  margin-bottom: 1.05rem;
  border-radius: 12px;
  background: #f3f4f6;
}
.tf-dlg__tab {
  border: none;
  background: transparent;
  border-radius: 10px;
  min-height: 40px;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--tf-muted);
  cursor: pointer;
  outline: none !important;
}
.tf-dlg__tab.is-on {
  background: #fff;
  color: var(--tf-teal-dark);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.tf-dlg__link {
  display: block;
  text-align: center;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tf-teal-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Bootstrap modal shell for shared auth dialog */
.modal.tf-auth-modal .modal-dialog {
  max-width: 460px;
  margin: 1.25rem auto;
}
.modal.tf-auth-modal .modal-content {
  background: transparent;
  border: none;
  box-shadow: none;
}
.modal.tf-auth-modal .modal-body,
.modal.tf-auth-modal .modal-header,
.modal.tf-auth-modal .modal-footer {
  padding: 0;
  border: none;
}
.tf-auth-backdrop {
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(3px);
}
.tf-auth-backdrop.in { opacity: 1 !important; }

.account-auth-page {
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef1f4;
}
.account-auth-page__hint {
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
}
.account-auth-page__hint button {
  border: none;
  background: none;
  color: #0090a6;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
