/*************************************************
 * LOGIN PAGE — ROYAL GOLD GLASS UI
 *************************************************/

.auth-page {
  position: relative;
  padding: 2.5rem 1rem;
  overflow: hidden;
  animation: authFadeIn 0.7s ease-out;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/*************************************************
 * BACKGROUND (Royal Gold Nebula)
 *************************************************/

.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
      circle at 10% 0%,
      rgba(245, 221, 102, 0.22),
      transparent 60%
    ),
    radial-gradient(
      circle at 90% 100%,
      rgba(218, 178, 65, 0.25),
      transparent 60%
    );
  opacity: 0.48;
  mix-blend-mode: screen;
  pointer-events: none;
}

.auth-page::after {
  animation: nebulaDrift 18s ease-in-out infinite;
}

/*************************************************
 * PARTICLES
 *************************************************/

.auth-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(245, 221, 102, 0.28);
  border-radius: 999px;
  animation: floatParticle 10s infinite ease-in-out;
}

.auth-particle:nth-child(1) {
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}
.auth-particle:nth-child(2) {
  top: 20%;
  right: 10%;
  animation-delay: 1s;
}
.auth-particle:nth-child(3) {
  bottom: 15%;
  left: 25%;
  animation-delay: 2s;
}
.auth-particle:nth-child(4) {
  bottom: 10%;
  right: 20%;
  animation-delay: 3s;
}
.auth-particle:nth-child(5) {
  top: 50%;
  left: 50%;
  animation-delay: 4s;
}

/*************************************************
 * FLOATING CUBE
 *************************************************/

.auth-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.auth-cube {
  position: relative;
  width: 46px;
  height: 46px;
  transform-style: preserve-3d;
  animation: cubeFloat 3.8s ease-in-out infinite;
}

.auth-cube-face {
  position: absolute;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #f5dd66, #dab241);
  box-shadow: 0 12px 25px rgba(245, 221, 102, 0.42);
}

/* Front */
.auth-cube-front {
  inset: 0;
}

/* Top */
.auth-cube-top {
  left: 4px;
  right: 4px;
  height: 18px;
  top: -10px;
  transform: skewX(-15deg);
  background: linear-gradient(135deg, #fff2a8, #e8c96a);
  opacity: 0.95;
}

/* Side */
.auth-cube-side {
  top: 6px;
  bottom: 4px;
  right: -8px;
  width: 18px;
  transform: skewY(-15deg);
  background: linear-gradient(135deg, #dab241, #f5dd66);
  opacity: 0.95;
}

/*************************************************
 * LOGO TEXT
 *************************************************/

.auth-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-logo-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: #f5dd66;
}

.auth-logo-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

/*************************************************
 * CARD (GLASS PANEL)
 *************************************************/

.auth-card {
  background: rgba(0, 0, 0, 0.78);
  border-radius: 1.3rem;
  padding: 2rem 1.8rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(245, 221, 102, 0.35);
  position: relative;
}

/* Shake animation when class .shake is added */
.auth-card.shake {
  animation: loginShake 0.6s ease;
}

/* Error red glow around card */
.auth-card.error {
  border-color: rgba(248, 113, 113, 0.85);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.7),
    0 20px 50px rgba(239, 68, 68, 0.45);
}

/* Glowing border (gold) */
.auth-card-animated::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0.35;
  filter: blur(4px);
  z-index: -1;
}

/* Tilt hover */
.auth-card-tilt {
  transform-origin: center center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-card-tilt:hover {
  transform: rotate3d(1, -1, 0, 5deg) translateY(-3px);
  box-shadow: 0 26px 55px rgba(245, 221, 102, 0.28);
}

/*************************************************
 * INPUT WRAPPERS + ICON FIELDS
 *************************************************/

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

.input-icon-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: 0.2s ease;
}

.input-icon-field i {
  width: 18px;
  height: 18px;
  color: rgba(245, 221, 102, 0.8);
}

.input-icon-field:focus-within {
  border-color: #f5dd66;
  box-shadow: 0 0 0 1px rgba(245, 221, 102, 0.55);
}

/*************************************************
 * INPUTS & BUTTON
 *************************************************/

.auth-input {
  width: 100%;
  padding: 0.1rem 0;
  border-radius: 0.7rem;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
}

/* Input error state */
.auth-input.input-error {
  color: #fecaca; /* light-red text tint */
}

.input-icon-field.input-icon-field-error {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.75),
    0 0 12px rgba(248, 113, 113, 0.45);
}

.input-icon-field.input-icon-field-error {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.75);
}

.auth-btn {
  background: #f5dd66;
  color: #181818;
  border: none;
  border-radius: 0.7rem;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: 0.22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-btn:hover:not(.disabled) {
  box-shadow: 0 14px 35px rgba(245, 221, 102, 0.6);
  transform: translateY(-2px);
}

.auth-btn.disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-link {
  color: #f5dd66;
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

/*************************************************
 * FORGOT PASSWORD LINK
 *************************************************/

.forgot-password-btn {
  margin-top: 0.3rem;
  background: none;
  border: none;
  color: rgba(245, 221, 102, 0.9);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  align-self: flex-end;
}

/*************************************************
 * LOGIN ERROR BOX
 *************************************************/

.login-error-box {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.9);
  font-size: 0.82rem;
  color: #fecaca;
}

.login-error-box i {
  width: 16px;
  height: 16px;
  color: #fecaca;
}

/*************************************************
 * SPINNER
 *************************************************/

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: rgba(0, 0, 0, 0.9);
  animation: spin 0.7s linear infinite;
}

.hidden {
  display: none;
}

/*************************************************
 * TOAST
 *************************************************/

.toast {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.9);
  color: #f9fafb;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.8);
  font-size: 0.85rem;
  min-width: 220px;
  max-width: 320px;
  opacity: 0;
  transform: translateY(-8px) translateX(10px);
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-show {
  opacity: 1;
  transform: translateY(0) translateX(0);
  pointer-events: auto;
}

.toast-success {
  border: 1px solid rgba(34, 197, 94, 0.8);
}

.toast-error {
  border: 1px solid rgba(248, 113, 113, 0.8);
}

/*************************************************
 * MODAL BACKDROP
 *************************************************/

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: 0.25s ease;
  z-index: 50;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/*************************************************
 * FORGOT PASSWORD MODAL
 *************************************************/

.forgot-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.88);
  transition: 0.25s ease;
}

.forgot-modal.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Modal inner */
.forgot-modal-inner {
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(245, 221, 102, 0.35);
  padding: 2rem;
  border-radius: 1rem;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
  animation: modalDrop 0.4s ease;
}

.forgot-modal-inner h2 {
  color: #f5dd66;
  margin-bottom: 0.4rem;
}

.forgot-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1rem;
}

/* Modal close button */
.modal-close-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.7rem;
  background: rgba(245, 221, 102, 0.15);
  border: 1px solid rgba(245, 221, 102, 0.4);
  border-radius: 0.5rem;
  color: #f5dd66;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(245, 221, 102, 0.25);
}

/*************************************************
 * ANIMATIONS
 *************************************************/

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nebulaDrift {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: rotate(10deg) scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 0.5;
  }
}

@keyframes floatParticle {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  20% {
    opacity: 0.9;
  }
  50% {
    transform: translateY(-20px);
  }
  80% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes cubeFloat {
  0% {
    transform: translateY(0px) rotate(-8deg);
  }
  50% {
    transform: translateY(-8px) rotate(4deg);
  }
  100% {
    transform: translateY(0px) rotate(-8deg);
  }
}

@keyframes loginShake {
  0% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-6px);
  }
  30% {
    transform: translateX(6px);
  }
  45% {
    transform: translateX(-5px);
  }
  60% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
  90% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes modalDrop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/*************************************************
 * RESPONSIVE
 *************************************************/

@media (max-width: 480px) {
  .auth-card {
    padding: 1.6rem 1.4rem;
  }
}
