/* ==========================================================================
   HOTEL CANTEEN MANAGEMENT SYSTEM - AUTHENTICATION MODULE
   File: css/auth.css
   Theme: 5-Star Luxury Dark Hotel Aesthetic (Login & Registration)
   ========================================================================== */

/* ==========================================================================
   1. AUTH PAGE LAYOUT & AMBIENT ANIMATED BACKGROUND
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary, #060b18);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Ambient Floating Glowing Orbs */
.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

/* Top-Left Gold / Amber Light Orb */
.auth-page::before {
  width: 480px;
  height: 480px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, rgba(217, 119, 6, 0.15) 50%, transparent 80%);
  animation-duration: 16s;
}

/* Bottom-Right Royal Blue / Purple Orb */
.auth-page::after {
  width: 550px;
  height: 550px;
  bottom: -150px;
  right: -120px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, rgba(139, 92, 246, 0.2) 50%, transparent 80%);
  animation-duration: 22s;
  animation-delay: -5s;
}

/* Center Auxiliary Gold Sheen */
.auth-ambient-light {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 650px;
  height: 650px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.04) 0%, transparent 70%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  animation: pulseGlow 10s ease-in-out infinite alternate;
}

/* ==========================================================================
   2. CSS-ONLY FLOATING STARS & PARTICLES
   ========================================================================== */
.auth-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  animation: particleFloat 14s infinite linear;
}

.particle:nth-child(1) { width: 3px; height: 3px; top: 15%; left: 20%; animation-duration: 12s; opacity: 0.6; }
.particle:nth-child(2) { width: 4px; height: 4px; top: 70%; left: 10%; animation-duration: 18s; opacity: 0.4; }
.particle:nth-child(3) { width: 2px; height: 2px; top: 40%; left: 80%; animation-duration: 15s; opacity: 0.8; }
.particle:nth-child(4) { width: 5px; height: 5px; top: 85%; left: 75%; animation-duration: 20s; opacity: 0.3; }
.particle:nth-child(5) { width: 3px; height: 3px; top: 25%; left: 65%; animation-duration: 16s; opacity: 0.5; }
.particle:nth-child(6) { width: 2px; height: 2px; top: 60%; left: 45%; animation-duration: 22s; opacity: 0.7; }

/* ==========================================================================
   3. AUTH WRAPPER & CONTAINER
   ========================================================================== */
.auth-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.auth-wrapper.auth-register {
  max-width: 540px;
}

/* ==========================================================================
   4. LUXURY GLASSMORPHISM AUTH CARD
   ========================================================================== */
.auth-card {
  background: rgba(12, 21, 40, 0.75);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-xl, 24px);
  padding: 3rem 2.5rem;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.7),
    0 0 35px rgba(245, 158, 11, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.auth-card:hover {
  box-shadow: 
    0 30px 70px -15px rgba(0, 0, 0, 0.85),
    0 0 45px rgba(245, 158, 11, 0.16);
  border-top-color: rgba(245, 158, 11, 0.6);
}

/* Elegant Golden Corner Accent Line */
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent, #f59e0b) 50%, transparent 100%);
  opacity: 0.9;
}

/* Subtle Card Glow Edge */
.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(245, 158, 11, 0.15) 40%, rgba(255, 255, 255, 0.02) 80%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==========================================================================
   5. HOTEL BRAND LOGO & HEADER
   ========================================================================== */
.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.25rem;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 
    0 8px 25px rgba(245, 158, 11, 0.35),
    0 0 0 5px rgba(245, 158, 11, 0.12);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-logo:hover {
  transform: scale(1.08) rotate(5deg);
}

.auth-hotel-icon {
  font-size: 2rem;
  color: #120600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary, #f1f5f9);
  letter-spacing: -0.025em;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary, #94a3b8);
  font-weight: 400;
  max-width: 320px;
  line-height: 1.5;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.75rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-pill, 9999px);
  color: var(--accent, #f59e0b);
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   6. ERROR BOX & ALERTS
   ========================================================================== */
.auth-error-box {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-left: 4px solid var(--danger, #ef4444);
  color: #fecaca;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideDownAlert 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.auth-error-icon {
  color: var(--danger, #ef4444);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.auth-success-box {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 4px solid var(--success, #10b981);
  color: #a7f3d0;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideDownAlert 0.4s ease-out forwards;
}

/* ==========================================================================
   7. FORM FIELDS & STAGGERED ENTRANCE
   ========================================================================== */
.auth-form {
  display: flex;
  flex-direction: column;
}

/* Staggered entrance for form groups */
.auth-form .form-group:nth-child(1) { animation: formFadeIn 0.5s ease 0.1s both; }
.auth-form .form-group:nth-child(2) { animation: formFadeIn 0.5s ease 0.2s both; }
.auth-form .form-group:nth-child(3) { animation: formFadeIn 0.5s ease 0.3s both; }
.auth-form .form-group:nth-child(4) { animation: formFadeIn 0.5s ease 0.4s both; }
.auth-form .form-group:nth-child(5) { animation: formFadeIn 0.5s ease 0.5s both; }
.auth-form .form-group:nth-child(6) { animation: formFadeIn 0.5s ease 0.6s both; }
.auth-form .auth-actions { animation: formFadeIn 0.5s ease 0.65s both; }

.auth-form .form-group {
  margin-bottom: 1.35rem;
  position: relative;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 1.15rem;
  color: var(--text-muted, #4b5563);
  font-size: 1rem;
  transition: color 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.auth-form .form-control {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary, #f1f5f9);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.auth-form .form-control:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.auth-form .form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent, #f59e0b);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.auth-form .form-control:focus + .auth-input-icon,
.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--accent, #f59e0b);
}

/* Password Toggle Visibility Button */
.auth-password-toggle {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted, #4b5563);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: color 0.2s;
  z-index: 2;
}

.auth-password-toggle:hover {
  color: var(--text-primary, #f1f5f9);
}

/* Floating Label Variant (Optional enhancement) */
.form-floating-custom {
  position: relative;
}

.form-floating-custom label {
  position: absolute;
  top: 50%;
  left: 2.85rem;
  transform: translateY(-50%);
  color: var(--text-muted, #4b5563);
  font-size: 0.9rem;
  pointer-events: none;
  transition: all 0.25s ease;
}

.form-floating-custom input:focus ~ label,
.form-floating-custom input:not(:placeholder-shown) ~ label {
  top: -0.5rem;
  left: 1rem;
  font-size: 0.75rem;
  color: var(--accent, #f59e0b);
  background: var(--bg-secondary, #0c1528);
  padding: 0 0.4rem;
  border-radius: 4px;
}

/* ==========================================================================
   8. REMEMBER ME & FORGOT PASSWORD ROW
   ========================================================================== */
.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -0.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.auth-remember-label {
  color: var(--text-secondary, #94a3b8);
  user-select: none;
  font-size: 0.85rem;
}

.auth-forgot-link {
  color: var(--accent, #f59e0b);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-forgot-link:hover {
  color: var(--accent-light, #fbbf24);
  text-decoration: underline;
}

/* ==========================================================================
   9. AUTH BUTTON (WITH SHINE EFFECT)
   ========================================================================== */
.auth-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #120600;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 18px rgba(245, 158, 11, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

/* Continuous Light Sweep Animation on Hover */
.auth-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  transition: transform 0.6s ease-in-out;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(245, 158, 11, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.auth-btn:hover::after {
  transform: translateX(450%) rotate(25deg);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   10. DIVIDER & ALTERNATIVE LINKS
   ========================================================================== */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
  color: var(--text-muted, #4b5563);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
  padding: 0 1rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #94a3b8);
}

.auth-link {
  color: var(--accent, #f59e0b);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  margin-left: 0.35rem;
}

.auth-link:hover {
  color: var(--accent-light, #fbbf24);
  text-decoration: underline;
}

/* ==========================================================================
   11. REGISTRATION SPECIFIC STYLES
   ========================================================================== */
.auth-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.role-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.role-option {
  position: relative;
}

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.role-card {
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 6px);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.role-card i,
.role-card svg {
  font-size: 1.25rem;
  color: var(--text-secondary, #94a3b8);
  transition: color 0.25s ease;
}

.role-card span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
}

.role-option input[type="radio"]:checked + .role-card {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--accent, #f59e0b);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.role-option input[type="radio"]:checked + .role-card i,
.role-option input[type="radio"]:checked + .role-card span {
  color: var(--accent, #f59e0b);
}

/* Password Strength Meter */
.strength-meter {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.strength-meter-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-meter-bar.weak { width: 33%; background: var(--danger, #ef4444); }
.strength-meter-bar.medium { width: 66%; background: var(--warning, #f59e0b); }
.strength-meter-bar.strong { width: 100%; background: var(--success, #10b981); }

/* ==========================================================================
   12. KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

@keyframes pulseGlow {
  0% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.2;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-80px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes slideDownAlert {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   13. RESPONSIVE DESIGN FOR AUTH PAGES
   ========================================================================== */
@media (max-width: 576px) {
  .auth-page {
    padding: 1.25rem 0.75rem;
  }

  .auth-card {
    padding: 2.25rem 1.5rem;
    border-radius: var(--radius-lg, 16px);
  }

  .auth-title {
    font-size: 1.55rem;
  }

  .auth-row-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .role-selector-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .role-card {
    flex-direction: row;
    justify-content: center;
    padding: 0.6rem;
  }
}
