:root {
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --bg-color: rgba(255, 255, 255, 0.15);
  --text-color: var(--color-primary);
  --border-color: rgba(255, 255, 255, 0.2);
  --box-shadow: 0 8px 32px rgba(var(--color-primary), 0.25);
}

[data-bs-theme=dark] {
  --text-color: #ffffff;
  --bg-color: rgba(18, 22, 28, 0.15);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Input Number Controls Reset */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

input[type=number] {
  -moz-appearance: textfield;
}

/* Auth Layout */
.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.auth-section::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background: linear-gradient(135deg, 
    var(--color-secondary) 0%,
    var(--color-primary) 100%,
    var(--color-secondary) 50%
  );
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
  z-index: 1;
}

/* Fix z-index and interaction layers */
.auth-section::after,
.auth-section .particles {
  pointer-events: none;
  z-index: 2;
}

.auth-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, var(--color-primary) 0%, transparent 35%),
    radial-gradient(circle at 80% 80%, var(--color-secondary) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, var(--color-primary) 0%, transparent 50%);
  animation: pulse 12s ease-in-out infinite alternate;
}

.auth-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.1) 50%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.1) 50%, transparent 52%);
  background-size: 30px 30px;
  animation: shimmer 60s linear infinite;
}

/* Floating Particles */
.auth-section .particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-section .particles::before,
.auth-section .particles::after,
.auth-section .particles span {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 
    0 0 40px 20px var(--color-primary),
    40vw 35vh 0 var(--color-secondary),
    75vw 25vh 0 var(--color-primary),
    15vw 65vh 0 var(--color-secondary),
    65vw 75vh 0 var(--color-primary),
    20vw 25vh 0 var(--color-secondary),
    85vw 65vh 0 var(--color-primary),
    10vw 85vh 0 var(--color-secondary),
    50vw 15vh 0 var(--color-primary);
  animation: float 20s linear infinite;
}

.auth-section .particles::after {
  animation-delay: -10s;
  animation-duration: 25s;
}

.auth-section .particles span {
  animation-delay: -5s;
  animation-duration: 22s;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% { background-position: 0 0; }
  100% { background-position: 100% 100%; }
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.8;
  }
  25% {
    transform: translate(25px, -40px) rotate(90deg) scale(1.2);
    opacity: 0.6;
  }
  50% {
    transform: translate(-15px, 50px) rotate(180deg) scale(0.9);
    opacity: 0.9;
  }
  75% {
    transform: translate(-35px, -30px) rotate(270deg) scale(1.1);
    opacity: 0.7;
  }
  100% {
    transform: translate(0, 0) rotate(360deg) scale(1);
    opacity: 0.8;
  }
}

.form-box {
  background: rgba(255, 255, 255, 1);  /* Changed from 0.85 to 1 for full opacity */
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 8px 32px rgba(139, 92, 246, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 0 80px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 40px;
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  position: relative;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
  z-index: 10;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Elements */
.form-box h2 {
  color: var(--text-color);
  margin-bottom: 30px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

.inputbox {
  position: relative;
  margin-bottom: 30px;
}

.inputbox input {
  width: 100%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  color: #4b5563;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  position: relative;
  z-index: 15;
}

.inputbox input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary);
  background: rgba(255, 255, 255, 0.2);
}

.inputbox label {
  z-index: 99;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #6b7280 !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  font-weight: 500;
  padding: 0 8px;
  pointer-events: none;
}

.inputbox input:focus ~ label,
.inputbox input:valid ~ label {
  top: -12px;
  right: 10px;
  font-size: 14px;
  background: linear-gradient(to right, var(--color-primary),var(--color-secondary));
  padding: 4px 12px;
  border-radius: 8px;
  color: var(--color-primary);
  font-weight: 600;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

/* OTP Inputs */
.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 30px 0;
}

.otp-inputs input {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-color);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  position: relative;
  z-index: 15;
}

.otp-inputs input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.otp-inputs input:disabled {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(var(--text-color), 0.5);
}

/* Home Link Styles */
.home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    color: var(--color-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    background: var(--color-primary);
    padding: 12px 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid var(--color-secondary);
    position: relative;
    z-index: 15;
}

.home-link:hover {
    background: var(--color-secondary);
    color: var(--color-secondary);
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: 0 5px 15px var(--color-secondary);
}

.home-link ion-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.home-link:hover ion-icon {
    transform: translateX(-4px);
}

[dir="rtl"] .home-link:hover ion-icon {
    transform: translateX(4px);
}

/* Button Styles */
.auth-button {
  width: 100%;
  padding: 15px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 15;
  box-shadow: 0 4px 6px -1px var(--color-primary);
}

.auth-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-primary) 20%, var(--color-secondary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px -3px var(--color-primary);
}

.auth-button:active:not(:disabled) {
  transform: translateY(0);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Loader Animation */
.auth-button .loader {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: rotate 1s linear infinite;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.auth-button.loading {
  color: transparent;
}

.auth-button.loading .loader {
  display: block;
}

@keyframes rotate {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Timer Styles */
.resend-timer {
    text-align: center;
    margin-top: 20px;
}

#timer {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(22, 17, 121, 0.08);
    backdrop-filter: blur(5px);
    display: inline-block;
}

#timer .text-primary {
    color: var(--secondary-color) !important;
    font-weight: 700;
    font-size: 16px;
}

.resend-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(22, 17, 121, 0.1);
    border-radius: 8px;
    font-weight: 500;
    color: var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
    z-index: 15;
}

.resend-link:hover {
    background: rgba(251, 150, 9, 0.2);
    transform: translateY(-1px);
}

/* Large Loader */
.large-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    z-index: 100;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-primary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.d-none {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .form-box {
    width: 90%;
    padding: 30px 20px;
  }
  
  .otp-inputs input {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}
