/* Login Page Styles - Modern Arabic Design */
:root {
  --color-primary: #050704;
  --color-primary-light: #684bff;
  --color-primary-dark: #050704;
  --color-gold: #684bff;
  --color-gold-light: #acfef8;
  --color-gold-dark: #684bff;
  --color-bg-light: #ebfafd;
  --color-bg-light-light: #f8f9fa;
  --color-text-dark: #050704;
  --color-text-light: #684bff;
  --color-muted: #acfef8;
  --color-error: #dc3545;
  --color-success: #28a745;
  
  /* Horizon background colors */
  --horizon-purple: #684bff;     /* your brand purple */
  --horizon-deep:   #3716a8;     /* deep violet */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #000;     /* top stays pure black */
  color: #ffffff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-size: 16px; /* Base font size for rem calculations */
}

/* Glossy Black Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    /* A) bottom glow/horizon (radial from below the viewport) */
    radial-gradient(120% 80% at 50% 115%,
      var(--horizon-purple) 0%,
      rgba(104,75,255,0.75) 18%,
      var(--horizon-deep) 36%,
      rgba(12,6,20,0.65) 55%,
      rgba(0,0,0,0.90) 75%,
      #000 100%),

    /* B) vertical fog rising up from the bottom */
    linear-gradient(to top,
      rgba(104,75,255,0.35) 0%,
      rgba(104,75,255,0.12) 28%,
      rgba(0,0,0,0) 55%),

    /* C) subtle vignette to keep edges dark */
    radial-gradient(140% 100% at 50% 30%,
      rgba(0,0,0,0) 45%,
      rgba(0,0,0,0.35) 70%,
      rgba(0,0,0,0.75) 100%);
  /* no animation; static like the reference */
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-light);
  box-shadow: 0 2px 20px rgba(104, 75, 255, 0.3);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}

.nav-logo .logo-text:hover {
  color: var(--color-gold);
}

.nav-logo .logo-img {
  width: 120px;
  height: 54px;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.nav-logo .logo-text:hover .logo-img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--color-text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.nav-link:hover {
  color: var(--color-gold);
}

/* Main Content */
.main-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 2rem 2rem;
}

/* Form Management */
.auth-form {
  transition: all 0.3s ease-in-out;
  opacity: 1;
  width: 100%;
  max-width: 100%;
}

.auth-form.hidden {
  display: none !important;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Simple fade transition */
.auth-form.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.auth-form.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Container enhancement during transition */
.auth-container.switching {
  transition: all 0.3s ease-in-out;
}

/* Enhanced container animation */
.auth-container {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(104,75,255,0.18);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  min-width: 320px;
  position: relative;
  overflow: visible;
  backdrop-filter: blur(10px) saturate(110%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-container.switching {
  transform: scale(1.02);
  box-shadow: 0 12px 50px rgba(104,75,255,0.25);
}

.form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.form-group {
  margin-bottom: 1rem;
  width: 100%;
  min-width: 0;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  width: 100%;
}

.form-group input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.8rem;
  background: rgba(52, 56, 70, 0.3);
  color: #ffffff;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
  /* Fix for autocomplete attributes */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-gold);
  background: rgba(74, 85, 104, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(104, 75, 255, 0.3);
}

/* Add autocomplete attributes support */
.form-group input[type="email"] {
  autocomplete: "email";
}

.form-group input[type="password"] {
  autocomplete: "current-password";
}

.form-group input[name="confirmPassword"] {
  autocomplete: "new-password";
}

.form-group input[name="signupPassword"] {
  autocomplete: "new-password";
}

.auth-button {
  width: 100%;
  min-width: 0;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.auth-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.auth-button:hover::before {
  left: 100%;
}

.auth-button:hover {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(104, 75, 255, 0.4);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-switch {
  text-align: center;
  margin-top: 2rem;
  color: #ffffff;
  font-size: 0.95rem;
  width: 100%;
}

.form-switch a {
  color: var(--color-gold);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.form-switch a:hover {
  color: var(--color-gold-dark);
}

/* Error and Success Messages */
.message {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.message.error {
  background: rgba(220, 53, 69, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(220, 53, 69, 0.2);
}

.message.success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(40, 167, 69, 0.2);
}

/* Loading State */
.auth-button.loading {
  position: relative;
  color: transparent;
}

.auth-button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design - Fixed */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .main-content {
    padding: 8rem 1rem 2rem 1rem;
  }
  
  .auth-container {
    padding: 2rem;
    margin: 0 1rem;
    max-width: 100%;
    min-width: 280px;
  }
  
  .form-title {
    font-size: 1.75rem;
  }
  
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-group input {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  
  .auth-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .auth-container {
    padding: 1.5rem;
    margin: 0 0.5rem;
    border-radius: 16px;
  }
  
  .form-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  .form-group input {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }
  
  .auth-button {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }
  
  .form-switch {
    margin-top: 1.5rem;
    font-size: 0.9rem;
  }
  
  .main-content {
    padding: 7rem 0.5rem 1rem 0.5rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .auth-container {
    padding: 1.25rem;
    margin: 0 0.25rem;
  }
  
  .form-title {
    font-size: 1.375rem;
  }
  
  .form-group input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .auth-button {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container {
  animation: fadeInUp 0.8s ease-out;
}

/* Fix for form switching animations */
.auth-form:not(.hidden) {
  animation: fadeInUp 0.4s ease-out;
}

/* Ensure proper form visibility */
#login-form:not(.hidden),
#signup-form:not(.hidden) {
  display: block !important;
  opacity: 1;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Fix for button text overflow */
.auth-button {
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.2;
}

/* Ensure form elements don't collapse */
.form-group,
.form-group input,
.form-group label,
.auth-button {
  min-height: 0;
  min-width: 0;
}

/* Fix for mobile input zoom */
@media (max-width: 480px) {
  .form-group input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 8px;
}

.strength-bar {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-fill.weak {
  width: 25%;
  background-color: #dc3545;
}

.strength-fill.fair {
  width: 50%;
  background-color: #ffc107;
}

.strength-fill.good {
  width: 75%;
  background-color: #17a2b8;
}

.strength-fill.strong {
  width: 100%;
  background-color: #28a745;
}

.strength-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

/* Password Requirements */
.password-requirements {
  margin-top: 8px;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.requirement {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
}

.requirement:last-child {
  margin-bottom: 0;
}

.requirement-icon {
  margin-left: 8px;
  font-size: 10px;
}

.requirement-text {
  color: rgba(255, 255, 255, 0.7);
}

.requirement.valid .requirement-icon {
  color: #28a745;
}

.requirement.valid .requirement-text {
  color: rgba(255, 255, 255, 0.9);
}

.requirement.invalid .requirement-icon {
  color: #dc3545;
}

.requirement.invalid .requirement-text {
  color: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 2rem;
  }
  
  .login-form,
  .login-info {
    width: 100%;
    max-width: none;
  }
  
  .login-form {
    order: 1;
  }
  
  .login-info {
    order: 2;
  }
  
  .login-form h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .form-group {
    margin-bottom: 1.5rem;
  }
  
  .form-group label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .form-group input {
    padding: 0.875rem;
    font-size: 1rem;
  }
  
  .login-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
  
  .login-info h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .login-info p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .signup-link {
    font-size: 1rem;
  }
}

/* Wide Monitor Support (1920px and above) */
@media (min-width: 1920px) {
  .auth-container {
    max-width: 500px;
    padding: 4rem;
  }
  
  .form-title {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
  }
  
  .form-group {
    margin-bottom: 2rem;
  }
  
  .form-group label {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .form-group input {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }
  
  .auth-button {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
  }
  
  .form-switch {
    font-size: 1rem;
  }
}

/* 2K Monitor Support (2560px and above) */
@media (min-width: 2560px) {
  .login-container {
    max-width: 2400px;
    margin: 0 auto;
    padding: 5rem 4rem;
    gap: 5rem;
  }
  
  .login-form,
  .login-info {
    padding: 4rem;
  }
  
  .login-form h2 {
    font-size: 3.5rem;
    margin-bottom: 3rem;
  }
  
  .form-group {
    margin-bottom: 2.5rem;
  }
  
  .form-group label {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .form-group input {
    padding: 1.5rem;
    font-size: 1.2rem;
  }
  
  .login-btn {
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
  }
  
  .login-info h2 {
    font-size: 3.5rem;
    margin-bottom: 3rem;
  }
  
  .login-info p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
  }
  
  .signup-link {
    font-size: 1.2rem;
  }
}

/* Ultra-Wide Monitor Support (3440px and above) */
@media (min-width: 3440px) {
  .login-container {
    max-width: 3200px;
    margin: 0 auto;
    padding: 6rem 5rem;
    gap: 6rem;
  }
  
  .login-form,
  .login-info {
    padding: 5rem;
  }
  
  .login-form h2 {
    font-size: 4rem;
    margin-bottom: 3.5rem;
  }
  
  .form-group {
    margin-bottom: 3rem;
  }
  
  .form-group label {
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
  }
  
  .form-group input {
    padding: 1.75rem;
    font-size: 1.3rem;
  }
  
  .login-btn {
    padding: 1.75rem 3.5rem;
    font-size: 1.4rem;
  }
  
  .login-info h2 {
    font-size: 4rem;
    margin-bottom: 3.5rem;
  }
  
  .login-info p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
  }
  
  .signup-link {
    font-size: 1.3rem;
  }
}

/* ========================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   ======================================== */

/* Mobile First Approach - Base styles for mobile */
@media screen and (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    .auth-container {
        padding: 2rem;
        max-width: 100%;
        margin: 0 1rem;
    }
    
    .form-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .auth-button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .login-info {
        width: 100%;
        padding: 2rem 1.5rem;
        order: 1;
        text-align: center;
    }
    
    .login-info h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .login-info p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }
    
    .signup-link {
        font-size: 1rem;
    }
}

/* Tablet Portrait */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}

/* Tablet Landscape */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}

/* Desktop */
@media screen and (min-width: 1200px) and (max-width: 1599px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}

/* Wide Monitor Support (1600px and above) */
@media screen and (min-width: 1600px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}

/* Ultra-Wide Monitor Support (1920px and above) */
@media screen and (min-width: 1920px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}

/* 2K Monitor Support (2560px and above) */
@media screen and (min-width: 2560px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}

/* 4K Monitor Support (3840px and above) */
@media screen and (min-width: 3840px) {
    .auth-container {
        max-width: 500px;
        padding: 4rem;
    }
    
    .form-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 2rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group input {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .auth-button {
        padding: 1.25rem 2.5rem;
        font-size: 1.2rem;
    }
    
    .form-switch {
        font-size: 1rem;
    }
}