/* ===== MODERN AUTH PAGES STYLES ===== */

/* Auth Layout */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

.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 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/><circle cx="900" cy="800" r="80" fill="url(%23a)"/></svg>') no-repeat center center;
  background-size: cover;
  opacity: 0.3;
  pointer-events: none;
}

.auth-wrapper {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Auth Illustration Side */
.auth-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: var(--space-8);
}

.auth-illustration h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-illustration p {
  font-size: var(--text-xl);
  margin-bottom: var(--space-8);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.auth-illustration-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  margin-bottom: var(--space-6);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

/* Auth Form Side */
.auth-form-container {
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 0;
}

.auth-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  display: block;
}

.auth-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-base);
  color: var(--gray-600);
  margin-bottom: 0;
}

/* Modern Form Styles */
.modern-form {
  width: 100%;
}

.modern-form-group {
  margin-bottom: var(--space-6);
  position: relative;
}

.modern-form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

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

.modern-input {
  width: 100%;
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-12);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--gray-900);
  background-color: var(--gray-50);
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  outline: none;
}

.modern-input:focus {
  background-color: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.modern-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.modern-input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: var(--text-lg);
  pointer-events: none;
  transition: color var(--transition-fast);
  z-index: 2;
}

.modern-input:focus + .modern-input-icon {
  color: var(--primary-color);
}

.modern-input.error {
  border-color: var(--error-color);
  background-color: rgba(239, 68, 68, 0.05);
}

.modern-input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.modern-input.error + .modern-input-icon {
  color: var(--error-color);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: var(--text-lg);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  z-index: 2;
}

.password-toggle:hover {
  color: var(--primary-color);
  background-color: rgba(102, 126, 234, 0.1);
}

/* Error Messages */
.modern-error-message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--error-color);
  animation: fadeIn 0.3s ease-out;
}

.modern-success-message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--success-color);
  animation: fadeIn 0.3s ease-out;
}

/* Modern Buttons */
.modern-btn {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

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

.modern-btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.modern-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.modern-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.modern-btn-secondary {
  background: var(--white);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.modern-btn-secondary:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Auth Links */
.auth-links {
  text-align: center;
  margin-top: var(--space-6);
}

.auth-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.auth-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: var(--space-6) 0;
  color: var(--gray-400);
  font-size: var(--text-sm);
}

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

.auth-divider::before {
  margin-right: var(--space-4);
}

.auth-divider::after {
  margin-left: var(--space-4);
}

/* Remember Me Checkbox */
.remember-me {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.modern-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.modern-checkbox:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.modern-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: 12px;
  font-weight: bold;
}

.remember-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}

/* Loading State */
.loading {
  position: relative;
  color: transparent !important;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Progress Bar for Registration */
.progress-container {
  margin-bottom: var(--space-8);
  width: 100%;
  overflow: hidden;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gray-200);
  z-index: 1;
}

.progress-line {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-slow);
  z-index: 2;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 3;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  background: var(--white);
  border: 3px solid var(--gray-200);
  color: var(--gray-400);
}

.step-circle.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  transform: scale(1.1);
}

.step-circle.completed {
  background: var(--success-color);
  border-color: var(--success-color);
  color: var(--white);
}

.step-circle.completed::after {
  content: '✓';
  font-size: 16px;
}

.step-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-align: center;
  font-weight: 500;
  white-space: normal;
  word-wrap: break-word;
  hyphens: auto;
  max-width: 100px;
  line-height: 1.2;
}

.step-label.active {
  color: var(--primary-color);
  font-weight: 600;
}

.step-label.completed {
  color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    max-width: 600px;
  }

  .auth-illustration {
    order: 2;
    padding: var(--space-4);
  }

  .auth-illustration h1 {
    font-size: var(--text-3xl);
  }

  .auth-illustration p {
    font-size: var(--text-lg);
  }

  .auth-form-container {
    order: 1;
  }
}

@media (max-width: 768px) {
  .auth-container {
    padding: var(--space-2);
  }

  .auth-wrapper {
    gap: var(--space-4);
  }

  .auth-form-container {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }

  .auth-title {
    font-size: var(--text-2xl);
  }

  .auth-illustration {
    display: none;
  }

  .progress-steps {
    flex-wrap: nowrap;
    gap: var(--space-1);
    overflow-x: auto;
    padding: 0 var(--space-2);
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .progress-steps::-webkit-scrollbar {
    display: none;
  }

  .progress-step {
    flex-shrink: 0;
    min-width: 85px;
  }

  .step-label {
    font-size: 9px;
    max-width: 80px;
    line-height: 1.1;
    word-wrap: break-word;
    hyphens: auto;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .auth-form-container {
    padding: var(--space-4);
    margin: var(--space-2);
  }

  .modern-input {
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-10);
  }

  .modern-input-icon {
    left: var(--space-3);
    font-size: var(--text-base);
  }

  .password-toggle {
    right: var(--space-3);
  }

  .progress-steps {
    justify-content: space-between;
    gap: var(--space-1);
    padding: 0 var(--space-1);
  }

  .progress-step {
    flex-shrink: 0;
    min-width: 70px;
  }

  .step-circle {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .step-label {
    font-size: 8px;
    max-width: 65px;
    line-height: 1.0;
    word-wrap: break-word;
    hyphens: auto;
    text-overflow: ellipsis;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* Extra small screens */
@media (max-width: 360px) {
  .progress-steps {
    gap: 2px;
    padding: 0;
  }

  .progress-step {
    min-width: 60px;
  }

  .step-circle {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .step-label {
    font-size: 7px;
    max-width: 55px;
    line-height: 0.9;
  }

  .auth-form-container {
    padding: var(--space-3);
    margin: var(--space-1);
  }
}

/* Special Animations */
.auth-form-container {
  animation: slideInFromBottom 0.6s ease-out;
  min-width: 0; /* Prevent flex item from overflowing */
  box-sizing: border-box;
}

.auth-illustration {
  animation: slideInFromTop 0.8s ease-out;
}

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

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus States for Accessibility */
.modern-btn:focus-visible,
.modern-input:focus-visible,
.auth-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .modern-input {
    border: 2px solid var(--gray-400);
  }

  .modern-input:focus {
    border: 2px solid var(--primary-color);
  }

  .modern-btn-primary {
    background: var(--primary-color);
  }
}

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