/**
 * Authentication Pages Styles
 * Styles for login, password reset, and other authentication pages
 */

/* ========================================
   AUTH PAGE LAYOUT
   ======================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

/* Background Pattern */
.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* ========================================
   AUTH CONTAINER
   ======================================== */

.auth-container {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

/* ========================================
   AUTH CARD
   ======================================== */

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  animation: fadeInUp 0.6s ease-out;
}

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

/* ========================================
   AUTH HEADER
   ======================================== */

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

.auth-logo {
  display: inline-flex;
  margin-bottom: var(--space-4);
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.auth-logo svg {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.auth-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-neutral-900);
  margin: 0 0 var(--space-3);
  animation: fadeIn 0.6s ease-out 0.3s both;
}

.auth-subtitle {
  font-size: var(--text-base);
  color: var(--color-neutral-600);
  line-height: var(--leading-relaxed);
  margin: 0;
  animation: fadeIn 0.6s ease-out 0.4s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   AUTH ICONS (Success/Error States)
   ======================================== */

.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: var(--space-4);
}

.auth-icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.auth-icon--error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* ========================================
   AUTH FORM
   ======================================== */

.auth-form {
  animation: fadeIn 0.6s ease-out 0.5s both;
}

.auth-form .form-group {
  margin-bottom: var(--space-5);
}

/* ========================================
   AUTH OPTIONS (Remember Me / Forgot Password)
   ======================================== */

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}

.auth-options .form-checkbox {
  margin-bottom: 0;
}

.auth-link {
  color: var(--color-primary-600);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: color var(--transition-fast);
}

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

.auth-link:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========================================
   AUTH SUBMIT BUTTON
   ======================================== */

.auth-submit {
  width: 100%;
  margin-bottom: var(--space-4);
}

/* ========================================
   AUTH FOOTER
   ======================================== */

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-neutral-200);
}

.auth-footer .auth-link {
  font-size: var(--text-base);
}

.auth-footer .btn {
  width: 100%;
}

/* ========================================
   ALERT STYLES IN AUTH CONTEXT
   ======================================== */

.auth-form .alert {
  margin-bottom: var(--space-6);
  animation: slideDown 0.3s ease-out;
}

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

/* Alert Component (if not already defined) */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert--success {
  background: #d1fae5;
  border-color: var(--color-success);
  color: #065f46;
}

.alert--error {
  background: #fee2e2;
  border-color: var(--color-error);
  color: #991b1b;
}

.alert--warning {
  background: #fef3c7;
  border-color: var(--color-warning);
  color: #92400e;
}

.alert--info {
  background: #dbeafe;
  border-color: var(--color-info);
  color: #1e40af;
}

.alert__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert__content {
  flex: 1;
}

.alert__title {
  font-weight: var(--font-semibold);
  margin: 0 0 var(--space-1);
  font-size: var(--text-sm);
}

.alert__message {
  font-size: var(--text-sm);
  margin: 0;
  line-height: var(--leading-normal);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

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

  .auth-card {
    padding: var(--space-6);
  }

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

  .auth-subtitle {
    font-size: var(--text-sm);
  }

  .auth-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-icon {
    width: 64px;
    height: 64px;
  }

  .auth-icon svg {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: var(--space-5);
  }

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

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus visible states for keyboard navigation */
.auth-form input:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* Ensure sufficient color contrast */
.auth-subtitle {
  color: var(--color-neutral-700);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-logo,
  .auth-title,
  .auth-subtitle,
  .auth-form,
  .auth-form .alert {
    animation: none;
  }

  .auth-page::before {
    animation: none;
  }
}

/* ========================================
   LOADING STATE
   ======================================== */

.auth-form--loading {
  pointer-events: none;
  opacity: 0.7;
}

.auth-form--loading .form-input,
.auth-form--loading .form-select {
  background: var(--color-neutral-100);
}

