/* ========================================
   AUTH PAGES - DARK THEME
   Modern login/register styling
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --auth-bg-primary: #0a0a0a;
  --auth-bg-secondary: #111111;
  --auth-bg-card: #151515;
  --auth-bg-input: #1a1a1a;
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-border-focus: rgba(204, 0, 7, 0.5);
  --auth-text-primary: #ffffff;
  --auth-text-secondary: rgba(255, 255, 255, 0.7);
  --auth-text-muted: rgba(255, 255, 255, 0.5);
  --auth-brand-red: #CC0007;
  --auth-brand-red-hover: #e60008;
  --auth-radius-sm: 8px;
  --auth-radius-md: 12px;
  --auth-radius-lg: 16px;
  --auth-radius-xl: 24px;
}

* {
  box-sizing: border-box;
}

body.login-page,
body.register-page {
  min-height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  background: var(--auth-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

/* Animated background gradient */
body.login-page::before,
body.register-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(204, 0, 7, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(204, 0, 7, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 30, 30, 1) 0%, var(--auth-bg-primary) 100%);
  z-index: 0;
}

/* Splash Screen - Dark Theme */
#splashScreen {
  background: var(--auth-bg-primary) !important;
}

#splashScreen .loader,
.loader {
  border: 3px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 3px solid var(--auth-brand-red) !important;
  border-radius: 50%;
  width: 40px !important;
  height: 40px !important;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.auth-wrapper {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--auth-bg-card);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-xl);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 10px 20px -5px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: cardSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  backdrop-filter: blur(10px);
}

@keyframes cardSlideIn {
  0% { 
    opacity: 0; 
    transform: translateY(30px) scale(0.98); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.auth-logo {
  width: 200px;
  margin-bottom: 32px;
  display: block;
  filter: brightness(1.1);
}

h1 {
  color: var(--auth-text-primary);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
  text-align: center;
}

h2 {
  font-size: 0.95rem;
  color: var(--auth-text-muted);
  margin: 0 0 24px 0;
  font-weight: 400;
  text-align: center;
}

/* Form Container */
.auth-card form,
.auth-card > input,
.auth-card > button {
  width: 100%;
}

/* Input Fields */
input[type="email"],
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  margin: 6px 0;
  display: block;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius-md);
  box-sizing: border-box;
  font-size: 15px;
  font-family: inherit;
  background: var(--auth-bg-input);
  color: var(--auth-text-primary);
  transition: all 0.2s ease;
}

input[type="email"]::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--auth-text-muted);
}

/* Autofill styling for dark theme */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--auth-bg-input) inset !important;
  -webkit-text-fill-color: var(--auth-text-primary) !important;
  border: 1px solid var(--auth-border) !important;
  caret-color: var(--auth-text-primary);
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--auth-brand-red);
  outline: none;
  background: var(--auth-bg-secondary);
  box-shadow: 0 0 0 3px rgba(204, 0, 7, 0.15);
}

input[type="email"]:hover,
input[type="text"]:hover,
input[type="password"]:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Primary Button */
button,
.auth-card button {
  width: 100%;
  padding: 14px 24px;
  background: var(--auth-brand-red);
  color: #fff;
  border: none;
  border-radius: var(--auth-radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(204, 0, 7, 0.25);
  position: relative;
  overflow: hidden;
}

button:hover,
.auth-card button:hover {
  background: var(--auth-brand-red-hover);
  box-shadow: 0 6px 20px rgba(204, 0, 7, 0.35);
  transform: translateY(-1px);
}

button:active,
.auth-card button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(204, 0, 7, 0.2);
}

/* Button shine effect */
button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

button:hover::before {
  left: 100%;
}

/* Links */
.toggle-link {
  color: var(--auth-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 20px;
  display: block;
  text-align: center;
  transition: color 0.2s ease;
}

.toggle-link:hover {
  color: var(--auth-text-primary);
}

/* Forgot password specific styling */
#forgotPasswordLink {
  color: var(--auth-text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

#forgotPasswordLink:hover {
  color: var(--auth-brand-red);
}

/* Error/Success Messages */
.auth-message {
  padding: 12px 16px;
  border-radius: var(--auth-radius-sm);
  font-size: 0.9rem;
  margin: 8px 0;
  text-align: center;
  width: 100%;
}

.auth-message.error {
  background: rgba(220, 53, 69, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.auth-message.success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 20px 0;
  color: var(--auth-text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider span {
  padding: 0 16px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
    margin: 16px;
    max-width: calc(100vw - 32px);
    border-radius: var(--auth-radius-lg);
  }
  
  .auth-logo {
    width: 160px;
    margin-bottom: 24px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }
  
  input[type="email"],
  input[type="text"],
  input[type="password"] {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  button {
    padding: 14px 20px;
    font-size: 1rem;
  }
  
  .toggle-link {
    font-size: 0.85rem;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .auth-card {
    padding: 24px 20px;
  }
  
  .auth-logo {
    width: 140px;
  }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .auth-wrapper {
    padding: 16px;
  }
  
  .auth-card {
    padding: 24px 32px;
    gap: 4px;
  }
  
  .auth-logo {
    width: 120px;
    margin-bottom: 16px;
  }
  
  h1 {
    font-size: 1.25rem;
  }
  
  h2 {
    margin-bottom: 12px;
  }
}
