/* Shared authentication experience */
.auth-page-shell,
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 16%, rgba(245, 158, 11, 0.10), transparent 26%),
    radial-gradient(circle at 92% 80%, rgba(10, 61, 145, 0.10), transparent 30%),
    #f4f7fb;
}

.auth-page-shell .auth-transition,
.auth-page .auth-transition {
  display: flex;
  width: 100%;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.auth-page-shell.page-exit .auth-transition,
.auth-page.page-exit .auth-transition {
  opacity: 0;
  transform: translateY(8px);
}

.auth-page-shell .auth-card-shell,
.auth-page .auth-card-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(440px, 1.18fr);
  width: min(100%, 1040px);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid rgba(10, 61, 145, 0.10);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 42, 86, 0.16);
}

.auth-page-shell .auth-panel,
.auth-page .auth-panel {
  min-width: 0;
}

.auth-page-shell .box-panel,
.auth-page .box-panel {
  position: relative;
  order: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px 38px;
  background:
    linear-gradient(155deg, rgba(5, 37, 91, 0.97), rgba(10, 61, 145, 0.94)),
    #0a3d91;
  color: #fff;
}

.auth-page-shell .box-panel::before,
.auth-page .box-panel::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -90px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.auth-page-shell .box-panel::after,
.auth-page .box-panel::after {
  content: "";
  position: absolute;
  bottom: -110px;
  left: -100px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.14);
}

.auth-page-shell .box-content,
.auth-page .box-content {
  position: relative;
  z-index: 1;
  max-width: 310px;
  text-align: center;
}

.auth-page-shell .auth-logo,
.auth-page .auth-logo {
  display: inline-flex;
  width: 98px;
  height: 112px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.20);
}

.auth-page-shell .auth-logo img,
.auth-page .auth-logo img {
  width: auto;
  height: 82px;
  object-fit: contain;
}

.auth-page-shell .box-content h2,
.auth-page .box-content h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1.25;
}

.auth-page-shell .box-content p,
.auth-page .box-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  line-height: 1.75;
}

.auth-page-shell .form-panel,
.auth-page .form-panel {
  order: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 54px;
  background: #fff;
}

.auth-page-shell .auth-form-title,
.auth-page .auth-form-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: #102a56;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.3;
}

.auth-page-shell .auth-form-title i,
.auth-page .auth-form-title i {
  color: var(--accent-orange);
  font-size: 0.9em;
}

.auth-page-shell .auth-form-subtitle,
.auth-page .auth-form-subtitle {
  margin: 8px 0 26px;
  color: #718096;
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-page-shell .auth-form-grid,
.auth-page .auth-form-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
}

.auth-page-shell .form-group,
.auth-page .form-group {
  margin: 0;
}

.auth-page-shell .form-label,
.auth-page .form-label {
  display: block;
  margin-bottom: 7px;
  color: #34445c;
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-page-shell .form-label i,
.auth-page .form-label i {
  width: 17px;
  margin-right: 4px;
  color: var(--primary-blue);
  text-align: center;
}

.auth-page-shell .form-control-auth,
.auth-page .form-control-auth {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  outline: none;
  background: #fbfcfe;
  color: #1f2937;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-page-shell .form-control-auth::placeholder,
.auth-page .form-control-auth::placeholder {
  color: #9aa7b8;
}

.auth-page-shell .form-control-auth:hover,
.auth-page .form-control-auth:hover {
  border-color: #c2cede;
}

.auth-page-shell .form-control-auth:focus,
.auth-page .form-control-auth:focus {
  border-color: var(--primary-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 61, 145, 0.10);
}

.auth-page-shell .password-input-wrap,
.auth-page .password-input-wrap {
  position: relative;
}

.auth-page-shell .form-control-auth.with-toggle,
.auth-page .form-control-auth.with-toggle {
  padding-right: 48px;
}

.auth-page-shell .password-toggle,
.auth-page .password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #728096;
  cursor: pointer;
}

.auth-page-shell .password-toggle:hover,
.auth-page .password-toggle:hover {
  background: rgba(10, 61, 145, 0.07);
  color: var(--primary-blue);
}

.auth-page-shell .remember-row,
.auth-page .remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
}

.auth-page-shell .remember-check,
.auth-page .remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.78rem;
  cursor: pointer;
}

.auth-page-shell .remember-check input,
.auth-page .remember-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-blue);
}

.auth-page-shell .remember-check i,
.auth-page .remember-check i {
  display: none;
}

.auth-page-shell .forgot-link,
.auth-page .forgot-link {
  color: var(--primary-blue);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.auth-page-shell .forgot-link:hover,
.auth-page .forgot-link:hover {
  color: #d97706;
}

.auth-page-shell .btn-auth-primary,
.auth-page-shell .btn-auth-secondary,
.auth-page .btn-auth-primary,
.auth-page .btn-auth-secondary {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-page-shell .btn-auth-primary,
.auth-page .btn-auth-primary {
  border: 1px solid var(--primary-blue);
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: #fff;
  box-shadow: 0 10px 22px rgba(10, 61, 145, 0.20);
}

.auth-page-shell .btn-auth-primary:hover,
.auth-page .btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(10, 61, 145, 0.28);
}

.auth-page-shell .btn-auth-secondary,
.auth-page .btn-auth-secondary {
  border: 1px solid #d7e0eb;
  background: #f8fafc;
  color: var(--primary-blue);
}

.auth-page-shell .btn-auth-secondary:hover,
.auth-page .btn-auth-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 61, 145, 0.32);
  background: #f1f5fa;
}

.auth-page-shell .auth-footer,
.auth-page .auth-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #edf1f5;
  text-align: center;
}

.auth-page-shell .auth-footer p,
.auth-page .auth-footer p {
  margin: 0 0 10px;
  color: #7b8798;
  font-size: 0.78rem;
}

.auth-page-shell .auth-note,
.auth-page .auth-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  color: #7c899b;
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: center;
}

.auth-page-shell .auth-note i,
.auth-page .auth-note i {
  margin-top: 2px;
  color: var(--accent-orange);
}

.auth-page-shell .otp-recipient-info,
.auth-page .otp-recipient-info {
  margin: 0 0 20px;
  padding: 13px 15px;
  border: 1px solid #dbe6f5;
  border-radius: 12px;
  background: #f5f8fd;
}

.auth-page-shell .otp-recipient-info .label,
.auth-page .otp-recipient-info .label {
  display: block;
  margin-bottom: 3px;
  color: #6e7c91;
  font-size: 0.72rem;
}

.auth-page-shell .otp-recipient-info .email,
.auth-page .otp-recipient-info .email {
  display: block;
  overflow: hidden;
  color: #183964;
  font-size: 0.85rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-page-shell #otp,
.auth-page #otp {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.auth-page-shell .button-group,
.auth-page .button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.otp-resend-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid #e3e9f1;
  border-radius: 12px;
  background: #fafbfd;
}

.otp-resend-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.otp-resend-copy > span {
  color: #415169;
  font-size: 0.76rem;
  font-weight: 600;
}

.otp-resend-copy small {
  color: #8490a1;
  font-size: 0.66rem;
}

.otp-resend-button {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(10, 61, 145, 0.22);
  border-radius: 9px;
  background: #fff;
  color: var(--primary-blue);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.otp-resend-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary-blue);
  background: #f2f6fc;
}

.otp-resend-button:disabled {
  border-color: #e2e7ee;
  background: #f4f6f9;
  color: #929dac;
  cursor: not-allowed;
}

#otpResendCountdown {
  font-variant-numeric: tabular-nums;
}

/* Toast notifications */
.toast-region {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border: 1px solid #dce4ee;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 42px rgba(15, 42, 86, 0.18);
  color: #334155;
  pointer-events: auto;
  animation: toastEnter 0.3s ease both;
}

.app-toast.is-leaving {
  animation: toastLeave 0.25s ease both;
}

.app-toast-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(10, 61, 145, 0.08);
  color: var(--primary-blue);
}

.app-toast-message {
  font-size: 0.8rem;
  line-height: 1.5;
}

.app-toast-close {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8793a5;
  cursor: pointer;
}

.app-toast-close:hover {
  background: #f1f4f8;
  color: #334155;
}

.app-toast.toast-error .app-toast-icon {
  background: rgba(220, 38, 38, 0.09);
  color: #dc2626;
}

.app-toast.toast-success .app-toast-icon {
  background: rgba(5, 150, 105, 0.10);
  color: #059669;
}

.app-toast.toast-warning .app-toast-icon {
  background: rgba(217, 119, 6, 0.10);
  color: #d97706;
}

@keyframes toastEnter {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastLeave {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 760px) {
  .auth-page-shell .auth-transition,
  .auth-page .auth-transition {
    padding: 34px 16px;
  }

  .auth-page-shell .auth-card-shell,
  .auth-page .auth-card-shell {
    display: block;
    width: min(100%, 540px);
    min-height: 0;
    border-radius: 22px;
  }

  .auth-page-shell .box-panel,
  .auth-page .box-panel {
    display: none;
  }

  .auth-page-shell .form-panel,
  .auth-page .form-panel {
    padding: 36px 28px;
  }

  .toast-region {
    top: 14px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

@media (max-width: 440px) {
  .auth-page-shell .form-panel,
  .auth-page .form-panel {
    padding: 30px 20px;
  }

  .auth-page-shell .button-group,
  .auth-page .button-group {
    grid-template-columns: 1fr;
  }

  .otp-resend-form {
    align-items: stretch;
    flex-direction: column;
  }

  .otp-resend-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast,
  .app-toast.is-leaving {
    animation: none;
  }
}
