/* Modern Auth Design System */
:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  --success-500: #10b981;
  --error-500: #ef4444;
  --warning-500: #f59e0b;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* Base Styles */
.auth-container {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

/* Ensure SVG icons are visible */
svg {
  display: inline-block;
  vertical-align: middle;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  min-width: 500px;
  max-width: 500px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.auth-header {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

.auth-logo {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.auth-logo img {
  height: 2rem;
  filter: none;
}

.auth-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-content {
  padding: 2rem 1.5rem;
}

.auth-section-title {
  margin-bottom: 1.5rem;
}

.auth-section-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-section-title h1::before {
  content: '';
  width: 4px;
  height: 1.5rem;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: 2px;
}

.auth-section-title p {
  color: var(--gray-500);
  font-size: 0.875rem;
  margin: 0;
  margin-left: 1.25rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label svg {
  width: 1rem;
  height: 1rem;
  color: var(--gray-500);
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: white;
  position: relative;
  z-index: 1;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input.error {
  border-color: var(--error-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
  border-color: var(--success-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
  z-index: 3;
  display: block;
}

.input-icon + .form-input {
  padding-left: 2.75rem;
}

.input-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  cursor: pointer;
  transition: color 0.2s ease;
  width: 1.25rem;
  height: 1.25rem;
  z-index: 3;
  display: block;
}

.input-toggle:hover {
  color: var(--gray-600);
}

.captcha-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.captcha-image {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.captcha-img {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  height: 3rem;
  object-fit: cover;
}

.captcha-refresh {
  padding: 0.5rem;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-refresh:hover {
  background: var(--gray-200);
  color: var(--primary-600);
}

.captcha-refresh svg {
  width: 1rem;
  height: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn::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 ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary-600);
  border: 2px solid var(--primary-600);
}

.btn-outline:hover {
  background: var(--primary-600);
  color: white;
  transform: translateY(-1px);
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.btn-social svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.btn-google {
  background: #db4437;
  color: white;
}

.btn-google:hover {
  background: #c23321;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-facebook {
  background: #4267b2;
  color: white;
}

.btn-facebook:hover {
  background: #365899;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled:hover {
  transform: none !important;
}

.error-message {
  color: var(--error-500);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.error-message svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.success-message {
  color: var(--success-500);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.success-message svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.auth-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.auth-footer p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin: 0;
}

.auth-footer a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

.countdown-timer {
  color: var(--primary-600);
  font-weight: 600;
}

.countdown-timer a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
}

.countdown-timer a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

.info-message {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--primary-800);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-message svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--gray-500);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.divider span {
  padding: 0 1rem;
  background: white;
}

.social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
}

.back-button:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

.back-button svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 640px) {
  .auth-container {
    padding: 0.5rem;
  }
  
  .auth-card {
    min-width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
  
  .auth-header {
    padding: 1.5rem 1rem;
  }
  
  .auth-content {
    padding: 1.5rem 1rem;
  }
  
  .auth-footer {
    padding: 1rem;
  }
  
  .social-buttons {
    grid-template-columns: 1fr;
  }
  
  .form-input {
    padding: 0.75rem 0.875rem;
  }
  
  .input-icon + .form-input {
    padding-left: 2.5rem;
  }
  
  .btn {
    padding: 0.75rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .auth-header {
    padding: 1rem;
  }
  
  .auth-content {
    padding: 1rem;
  }
  
  .auth-title {
    font-size: 1.25rem;
  }
  
  .auth-section-title h1 {
    font-size: 1.125rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

/* Loading States */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Focus States for Accessibility */
.form-input:focus,
.btn:focus,
.back-button:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .auth-card {
    border: 2px solid var(--gray-800);
  }
  
  .form-input {
    border-width: 2px;
  }
  
  .btn {
    border: 2px solid transparent;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .auth-header::before {
    animation: none;
  }
}
