/* ── Registration form UX improvements ─────────────────────────────────── */

#registerStepper .ki-loading {
  animation: register-spin 1s linear infinite;
}

@keyframes register-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#registerProgressBar {
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

#registerProgressBar .progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0095e8, #00b88d);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 25%;
}

#registerErrorSummary {
  border-radius: 0.75rem;
}

#registerErrorSummary .error-summary-item {
  cursor: pointer;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(220, 38, 38, 0.1);
}

#registerErrorSummary .error-summary-item:last-child {
  border-bottom: none;
}

#registerErrorSummary .error-summary-item:hover {
  text-decoration: underline;
}

#terms_agreement:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

[data-bs-theme="dark"] #registerProgressBar {
  background: rgba(255, 255, 255, 0.08);
}

/* ── Login form UX improvements ────────────────────────────────────────── */

#loginForm .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475467;
}

#loginForm .form-control:focus {
  border-color: #1e3ea0;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

#loginForm .form-control:focus-visible {
  outline: 2px solid rgba(30, 62, 160, 0.5);
  outline-offset: 1px;
}

#loginForm #togglePassword:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

#loginForm .password-input-wrap {
  position: relative;
}

#loginForm .password-input-wrap #password {
  padding-right: 2.75rem;
}

#loginForm .password-input-wrap #togglePassword {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#loginForm #rememberMe {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: #1e3ea0;
}

#loginForm #rememberMe:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

#loginForm .cursor-pointer {
  cursor: pointer;
}

#loginForm #clientError,
#loginForm #serverError {
  border-radius: 0.75rem;
  font-size: 0.875rem;
}

#loginForm #clientError .btn-close,
#loginForm #serverError .btn-close {
  opacity: 0.6;
}

#loginForm #throttleCountdown {
  font-size: 0.875rem;
  text-align: center;
}

[data-bs-theme="dark"] #loginForm .form-label {
  color: #cbd5e1;
}

[data-bs-theme="dark"] #loginForm .form-control {
  background-color: rgba(15, 23, 42, 0.4);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

[data-bs-theme="dark"] #loginForm .form-control::placeholder {
  color: #64748b;
}

[data-bs-theme="dark"] #loginForm .form-check-label {
  color: #cbd5e1 !important;
}

[data-bs-theme="dark"] #loginForm #clientError,
[data-bs-theme="dark"] #loginForm #serverError {
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

/* ── Reset password form password toggle ────────────────────────────────── */

#resetForm .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475467;
}

#resetForm .form-control:focus {
  border-color: #1e3ea0;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

#resetForm .form-control:focus-visible {
  outline: 2px solid rgba(30, 62, 160, 0.5);
  outline-offset: 1px;
}

#resetForm .password-input-wrap {
  position: relative;
}

#resetForm .password-input-wrap #password,
#resetForm .password-input-wrap #password_confirmation {
  padding-right: 2.75rem;
}

#resetForm .password-input-wrap #togglePassword,
#resetForm .password-input-wrap #togglePasswordConfirmation {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#resetForm #togglePassword:focus-visible,
#resetForm #togglePasswordConfirmation:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

#resetForm #passwordStrengthBars > div {
  transition: background-color 0.3s ease;
}

#resetForm #passwordStrengthBars > div.bg-active-success {
  background-color: #00b88d !important;
}

#resetForm #password_match_status {
  font-size: 0.8125rem;
}

#resetForm #resetError {
  border-radius: 0.75rem;
  font-size: 0.875rem;
}

#resetForm #resetError .btn-close {
  opacity: 0.6;
}

#resetForm #submitButton.btn-dark {
  color: #ffffff !important;
  background-color: #1e2129 !important;
  border-color: #1e2129 !important;
}

#resetForm #submitButton.btn-dark:hover,
#resetForm #submitButton.btn-dark:focus {
  color: #ffffff !important;
  background-color: #15171d !important;
  border-color: #15171d !important;
}

[data-bs-theme="dark"] #resetForm .form-label {
  color: #cbd5e1;
}

[data-bs-theme="dark"] #resetForm .form-control {
  background-color: rgba(15, 23, 42, 0.4);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
}

[data-bs-theme="dark"] #resetForm .form-control::placeholder {
  color: #64748b;
}

[data-bs-theme="dark"] #resetForm #resetError {
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

[data-bs-theme="dark"] #resetForm #submitButton.btn-dark {
  color: #ffffff !important;
  background-color: #1e3ea0 !important;
  border-color: #1e3ea0 !important;
}

[data-bs-theme="dark"] #resetForm #submitButton.btn-dark:hover,
[data-bs-theme="dark"] #resetForm #submitButton.btn-dark:focus {
  background-color: #1e3ea0 !important;
  border-color: #1e3ea0 !important;
}

/* ── Reusable password reveal toggle ────────────────────────────────────── */

.password-input-wrap {
  position: relative;
}

.password-input-wrap .form-control {
  padding-right: 2.75rem;
}

.password-input-wrap .password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-input-wrap .password-toggle:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Login page button fixes */
#loginButton.btn-dark {
  color: #ffffff !important;
  background-color: #1e2129 !important;
  border-color: #1e2129 !important;
}

#loginButton.btn-dark:hover,
#loginButton.btn-dark:focus {
  color: #ffffff !important;
  background-color: #15171d !important;
  border-color: #15171d !important;
}

[data-bs-theme="dark"] #loginButton.btn-dark {
  color: #ffffff !important;
  background-color: #1e3ea0 !important;
  border-color: #1e3ea0 !important;
}

[data-bs-theme="dark"] #loginButton.btn-dark:hover,
[data-bs-theme="dark"] #loginButton.btn-dark:focus {
  color: #ffffff !important;
  background-color: #1e3ea0 !important;
  border-color: #1e3ea0 !important;
}

.auth-2fa-card {
  width: min(100%, 980px);
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

.auth-2fa-side {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #1e3ea0 0%, #008080 100%);
  color: #ffffff;
}

.auth-2fa-side::before {
  content: "";
  position: absolute;
  inset: auto -15% -20% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  pointer-events: none;
}

.auth-2fa-side::after {
  content: "";
  position: absolute;
  inset: -15% auto auto -10%;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(96, 165, 250, 0.28) 0%,
    rgba(96, 165, 250, 0) 72%
  );
  pointer-events: none;
}

.auth-2fa-side > * {
  position: relative;
  z-index: 1;
}

.auth-2fa-side .badge {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.auth-2fa-side-muted {
  color: rgba(255, 255, 255, 0.78);
}

.auth-2fa-checklist {
  display: grid;
  gap: 1rem;
}

.auth-2fa-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.auth-2fa-checklist-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-2fa-main {
  background: #ffffff;
  color: #101828;
}

.auth-2fa-panel {
  width: min(100%, 430px);
}

.auth-2fa-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: #f8fafc;
  color: #475467;
  font-weight: 600;
  word-break: break-all;
}

.auth-2fa-input-wrap {
  position: relative;
}

.auth-2fa-code-input,
.auth-2fa-backup-input {
  min-height: 3.75rem;
  border-radius: 1rem;
  border: 1px solid #d0d5dd;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.auth-2fa-code-input {
  padding: 0.95rem 1.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auth-2fa-code-input::placeholder {
  letter-spacing: 0.25rem;
  color: #98a2b3;
}

.auth-2fa-backup-input {
  padding: 0.95rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08rem;
}

.auth-2fa-code-input:focus,
.auth-2fa-backup-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 0.25rem rgba(29, 78, 216, 0.12);
}

.auth-2fa-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

.auth-2fa-slot {
  min-height: 3.5rem;
  border-radius: 1rem;
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: #101828;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.auth-2fa-slot.is-filled {
  border-color: rgba(29, 78, 216, 0.35);
  background: rgba(29, 78, 216, 0.08);
}

.auth-2fa-slot.is-active {
  border-color: #1d4ed8;
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.12);
}

.auth-2fa-meta-card {
  border-radius: 1rem;
  border: 1px solid #eaecf0;
  background: #f8fafc;
}

.auth-2fa-inline-note {
  color: #667085;
  font-size: 0.925rem;
}

.auth-2fa-main .form-label,
.auth-2fa-main .text-gray-900 {
  color: #101828 !important;
}

.auth-2fa-main .text-gray-700 {
  color: #344054 !important;
}

.auth-2fa-main .form-text,
.auth-2fa-main .text-muted {
  color: #667085 !important;
}

.auth-2fa-main .btn-light-primary {
  background: #f0f9ff !important;
  border-color: #7dd3fc !important;
  color: #075985 !important;
}

.auth-2fa-main .btn-light-primary:hover,
.auth-2fa-main .btn-light-primary:focus {
  background: #e0f2fe !important;
  border-color: #38bdf8 !important;
  color: #0c4a6e !important;
}

.auth-2fa-main .border-gray-200 {
  border-color: #eaecf0 !important;
}

[data-bs-theme="dark"] .auth-2fa-card {
  border-color: rgba(148, 163, 184, 0.22);
  background: #111827;
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.55);
}

[data-bs-theme="dark"] .auth-2fa-side {
  background: linear-gradient(160deg, #0f172a 0%, #1d4ed8 100%);
}

[data-bs-theme="dark"] .auth-2fa-side::before {
  background: radial-gradient(
    circle,
    rgba(37, 99, 235, 0.18) 0%,
    rgba(37, 99, 235, 0) 70%
  );
}

[data-bs-theme="dark"] .auth-2fa-side::after {
  background: radial-gradient(
    circle,
    rgba(14, 165, 233, 0.12) 0%,
    rgba(14, 165, 233, 0) 72%
  );
}

[data-bs-theme="dark"] .auth-2fa-side .badge {
  background: rgba(255, 255, 255, 0.08);
  color: #e5edff;
}

[data-bs-theme="dark"] .auth-2fa-side-muted {
  color: rgba(226, 232, 240, 0.82);
}

[data-bs-theme="dark"] .auth-2fa-checklist-icon {
  background: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .auth-2fa-checklist-item {
  background: rgba(15, 23, 42, 0.22);
  border-color: rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .auth-2fa-main {
  background: #111827;
  color: #e5e7eb;
}

[data-bs-theme="dark"] .auth-2fa-user-pill {
  background: rgba(15, 23, 42, 0.55);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .auth-2fa-meta-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: #0f172a;
}

[data-bs-theme="dark"] .auth-2fa-main .form-label,
[data-bs-theme="dark"] .auth-2fa-main .text-gray-900 {
  color: #f8fafc !important;
}

[data-bs-theme="dark"] .auth-2fa-main .text-gray-700 {
  color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .auth-2fa-main .form-text,
[data-bs-theme="dark"] .auth-2fa-main .text-muted,
[data-bs-theme="dark"] .auth-2fa-inline-note {
  color: #94a3b8 !important;
}

[data-bs-theme="dark"] .auth-2fa-code-input,
[data-bs-theme="dark"] .auth-2fa-backup-input {
  background: #020617;
  border-color: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}

[data-bs-theme="dark"] .auth-2fa-code-input::placeholder,
[data-bs-theme="dark"] .auth-2fa-backup-input::placeholder {
  color: #64748b;
}

[data-bs-theme="dark"] .auth-2fa-code-input:focus,
[data-bs-theme="dark"] .auth-2fa-backup-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.25rem rgba(96, 165, 250, 0.18);
}

[data-bs-theme="dark"] .auth-2fa-slot {
  border-color: rgba(148, 163, 184, 0.22);
  background: #0f172a;
  color: #f8fafc;
}

[data-bs-theme="dark"] .auth-2fa-slot.is-filled {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.16);
}

[data-bs-theme="dark"] .auth-2fa-slot.is-active {
  border-color: #60a5fa;
  background: #111827;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

[data-bs-theme="dark"] .auth-2fa-main .btn-dark {
  background: #2563eb;
  border-color: #2563eb;
  color: #eff6ff;
}

[data-bs-theme="dark"] .auth-2fa-main .btn-dark:hover,
[data-bs-theme="dark"] .auth-2fa-main .btn-dark:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

[data-bs-theme="dark"] .auth-2fa-main .btn-light-primary {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

[data-bs-theme="dark"] .auth-2fa-main .btn-light-primary:hover,
[data-bs-theme="dark"] .auth-2fa-main .btn-light-primary:focus {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

[data-bs-theme="dark"] .auth-2fa-main .alert-danger {
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

[data-bs-theme="dark"] .auth-2fa-main .badge-light-primary {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

[data-bs-theme="dark"] .auth-2fa-main .badge-light-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

[data-bs-theme="dark"] .auth-2fa-main .border-gray-200 {
  border-color: rgba(148, 163, 184, 0.18) !important;
}

.auth-2fa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.auth-2fa-message:empty {
  display: none;
}

.auth-2fa-main .auth-2fa-submit {
  min-height: 3.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: #0f172a;
  color: #f8fafc;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.auth-2fa-main .auth-2fa-submit:hover,
.auth-2fa-main .auth-2fa-submit:focus {
  background: linear-gradient(135deg, #0b1220 0%, #172235 100%);
  border-color: #0b1220;
  color: #ffffff !important;
}

.auth-2fa-submit:focus-visible,
.auth-2fa-backup-cta:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(29, 78, 216, 0.22);
}

.auth-2fa-main .auth-2fa-backup-cta {
  min-height: 3.5rem;
  border-radius: 1rem;
  background: #f0f9ff !important;
  border: 1px solid #7dd3fc !important;
  color: #075985 !important;
  font-weight: 700;
}

.auth-2fa-main .auth-2fa-backup-cta:hover,
.auth-2fa-main .auth-2fa-backup-cta:focus {
  background: #e0f2fe !important;
  border-color: #38bdf8 !important;
  color: #0c4a6e !important;
}

[data-bs-theme="dark"] .auth-2fa-main .auth-2fa-submit {
  background: #2563eb;
  border-color: #2563eb;
  color: #eff6ff;
  box-shadow: none;
}

[data-bs-theme="dark"] .auth-2fa-main .auth-2fa-submit:hover,
[data-bs-theme="dark"] .auth-2fa-main .auth-2fa-submit:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

[data-bs-theme="dark"] .auth-2fa-main .auth-2fa-backup-cta {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

[data-bs-theme="dark"] .auth-2fa-main .auth-2fa-backup-cta:hover,
[data-bs-theme="dark"] .auth-2fa-main .auth-2fa-backup-cta:focus {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.auth-2fa-support-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 991.98px) {
  .auth-2fa-card {
    width: min(100%, 720px);
  }

  .auth-2fa-panel {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .auth-2fa-card {
    border-radius: 1.25rem;
  }

  .auth-2fa-code-input {
    font-size: 1.2rem;
    letter-spacing: 0.35rem;
  }

  .auth-2fa-slots {
    gap: 0.45rem;
  }

  .auth-2fa-slot {
    min-height: 3rem;
    border-radius: 0.8rem;
    font-size: 1rem;
  }
}
