/* Auth pages — custom UI enhancements */

.authentication-wrapper.authentication-cover {
  align-items: stretch;
}

.authentication-wrapper.authentication-cover .authentication-inner {
  min-height: 100vh;
  height: auto;
}

/* Cover panel — full-bleed image + overlay */
.auth-cover-panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  background: #1a1f35;
}

.auth-cover-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-cover-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  animation: authCoverKenBurns 22s ease-in-out infinite alternate;
  will-change: transform;
}

.auth-cover-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(26, 31, 53, 0.15) 0%,
      rgba(26, 31, 53, 0.35) 40%,
      rgba(20, 24, 45, 0.78) 72%,
      rgba(15, 18, 38, 0.92) 100%
    ),
    linear-gradient(
      135deg,
      rgba(105, 108, 255, 0.12) 0%,
      transparent 55%
    );
  pointer-events: none;
}

.auth-cover-panel::before,
.auth-cover-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.auth-cover-panel::before {
  width: 22rem;
  height: 22rem;
  top: -6rem;
  right: -4rem;
  background: radial-gradient(circle, rgba(105, 108, 255, 0.18) 0%, transparent 70%);
  animation: authOrbFloat 8s ease-in-out infinite alternate;
}

.auth-cover-panel::after {
  width: 16rem;
  height: 16rem;
  bottom: 20%;
  left: -3rem;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.12) 0%, transparent 70%);
  animation: authOrbFloat 10s ease-in-out infinite alternate-reverse;
}

.auth-cover-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 36rem;
  padding: 2.5rem 3rem 3.25rem;
  text-align: center;
  color: #fff;
}

.auth-cover-brand {
  margin-bottom: 1.75rem;
}

.auth-cover-logo-wrap {
  display: inline-block;
  padding: 0.75rem 1.125rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
}

.auth-cover-logo {
  display: block;
  max-height: 4.5rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.auth-cover-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #ffffff 30%, #d4d9ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-cover-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.auth-cover-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.75rem;
}

.auth-cover-brand h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.auth-cover-brand p {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 0;
  line-height: 1.7;
}

/* Staggered entrance animations */
.auth-anim-item {
  opacity: 0;
  animation: authFadeUp 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.15s + var(--anim-order, 1) * 0.18s);
}

.auth-cover-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  align-items: center;
}

.auth-cover-features li {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s ease, background 0.35s ease, border-color 0.35s ease;
  width: auto;
  max-width: 100%;
}

.auth-cover-features li:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.auth-cover-features li i {
  font-size: 1.2rem;
  flex-shrink: 0;
  color: #a8e6cf;
  animation: authIconPulse 2.5s ease-in-out infinite;
  animation-delay: calc(var(--anim-order, 1) * 0.4s);
}

@keyframes authCoverKenBurns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.07);
  }
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authOrbFloat {
  from {
    transform: translate(0, 0);
    opacity: 0.6;
  }
  to {
    transform: translate(12px, -16px);
    opacity: 1;
  }
}

@keyframes authIconPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-cover-bg-img,
  .auth-cover-panel::before,
  .auth-cover-panel::after,
  .auth-anim-item,
  .auth-cover-features li i {
    animation: none !important;
  }

  .auth-anim-item {
    opacity: 1;
  }
}

/* Form panel */
.auth-form-panel {
  min-height: 100vh;
  background-color: #f5f5f9;
}

.auth-form-card {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 0.125rem 0.75rem rgba(67, 89, 113, 0.08);
  border: 1px solid rgba(67, 89, 113, 0.06);
}

.auth-form-card .app-brand {
  margin-bottom: 1.5rem;
  justify-content: center;
}

.auth-form-card .app-brand-link {
  justify-content: center;
}

.auth-header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.auth-header h4 {
  font-size: 1.375rem;
  font-weight: 600;
  color: #566a7f;
  margin-bottom: 0.375rem;
}

.auth-header p {
  font-size: 0.9375rem;
  color: #a1acb8;
  margin-bottom: 0;
}

.auth-form-card .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #566a7f;
}

.auth-form-card .form-control {
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
}

.auth-form-card .form-control:focus {
  border-color: #696cff;
  box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.15);
}

.auth-form-card .input-group-merge .input-group-text {
  border-radius: 0.5rem 0 0 0.5rem;
}

[dir="rtl"] .auth-form-card .input-group-merge .form-control {
  border-radius: 0 0.5rem 0.5rem 0;
}

[dir="rtl"] .auth-form-card .input-group-merge .input-group-text {
  border-radius: 0.5rem 0 0 0.5rem;
}

.auth-form-card .btn-primary,
.auth-form-card .btn-success {
  padding: 0.6875rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 0;
  font-size: 0.9375rem;
  color: #a1acb8;
}

.auth-footer-link a {
  font-weight: 500;
}

/* Account type radio group */
.auth-account-type {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f5f5f9;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}

.auth-account-type .form-check {
  margin-bottom: 0;
}

/* OTP row */
.auth-otp-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.auth-otp-row .form-control {
  flex: 1;
}

.auth-otp-row .btn {
  flex-shrink: 0;
  min-width: 7.5rem;
  white-space: nowrap;
}

/* Forgot password steps */
.auth-steps {
  background: #f5f5f9;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.auth-steps ol {
  margin: 0;
  padding-right: 1.25rem;
  font-size: 0.8125rem;
  color: #697a8d;
  line-height: 1.8;
}

.auth-steps ol li {
  margin-bottom: 0.25rem;
}

.auth-steps ol li:last-child {
  margin-bottom: 0;
}

.auth-sms-timer {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* Ensure alerts appear above auth cover panel */
.swal2-container {
  z-index: 99999 !important;
}

#toast-container {
  z-index: 99999 !important;
}

.auth-form-card .fv-plugins-message-container {
  margin-top: 0.35rem;
}

.auth-form-card .fv-plugins-message-container .fv-help-block {
  color: #ff3e1d;
  font-size: 0.8125rem;
}

/* Register form scroll on smaller screens */
@media (max-height: 800px) and (min-width: 992px) {
  .auth-form-panel {
    align-items: flex-start !important;
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 991.98px) {
  .auth-form-panel {
    background: #f0f2f5;
    padding-top: 2rem !important;
  }

  .auth-form-card {
    box-shadow: 0 0.25rem 1.5rem rgba(67, 89, 113, 0.12);
  }
}
