/* ========================================
   AUTHENTICATION PAGE STYLES
======================================== */

/* Auth Page Layout */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Effect */
.auth-ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at 50% 30%,
    oklch(12% 0.12 210 / 0.3) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 0;
}

/* Back to Home Link */
.back-home {
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-button);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  z-index: 10;
}

.back-home::after {
  display: none;
}

.back-home svg {
  width: 20px;
  height: 20px;
}

.back-home:hover {
  color: var(--color-accent);
  transform: translateX(-4px);
}

/* Auth Container */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

/* Auth Logo */
.auth-logo {
  width: 80px;
  height: 80px;
  color: var(--color-accent);
  filter: drop-shadow(var(--glow-accent));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Auth Card */
.auth-card {
  width: 100%;
  background: var(--color-bg-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-elev-2);
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.auth-header h1 {
  font-family: var(--font-title);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.01em;
}

.auth-header p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* ========================================
   ALERT MESSAGES
======================================== */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: oklch(15% 0.08 25 / 0.5);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  animation: slideDown 0.3s var(--ease-smooth);
}

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

.auth-alert.success {
  background: oklch(15% 0.08 150 / 0.5);
  border-color: var(--color-success);
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-danger);
}

.auth-alert.success .alert-icon {
  color: var(--color-success);
}

/* ========================================
   FORM STYLES
======================================== */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-family: var(--font-button);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-0);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--text-md);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent-soft);
  background: var(--color-bg-1);
  box-shadow: 0 0 0 3px oklch(78% 0.19 210 / 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
  border-color: var(--color-danger);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
}

.password-input-wrapper .form-input {
  padding-right: 48px;
}

.toggle-password,
.toggle-password-confirm {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.toggle-password:hover,
.toggle-password-confirm:hover {
  color: var(--color-accent);
}

.toggle-password svg,
.toggle-password-confirm svg {
  width: 20px;
  height: 20px;
}

/* Form Options (Remember Me, Forgot Password) */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.checkbox-label span {
  line-height: 1.4;
}

/* Inline Links */
.inline-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.inline-link::after {
  display: none;
}

.inline-link:hover {
  color: var(--color-accent-glow);
  text-decoration: underline;
}

/* Forgot Password Link */
.forgot-link {
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
  white-space: nowrap;
}

.forgot-link::after {
  display: none;
}

.forgot-link:hover {
  color: var(--color-accent-glow);
  text-decoration: underline;
}

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

.btn-submit {
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-accent);
  color: var(--color-bg-0);
  font-family: var(--font-button);
  font-size: var(--text-md);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--duration-mid) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
  background: var(--color-accent-glow);
  transform: translateY(-2px);
  box-shadow: var(--glow-accent);
}

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

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Button Loading State */
.btn-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

.spinner circle {
  stroke-dasharray: 50;
  stroke-dashoffset: 25;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   DIVIDER
======================================== */

.auth-divider {
  position: relative;
  text-align: center;
  margin: var(--space-lg) 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border-subtle);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 var(--space-md);
  background: var(--color-bg-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   SOCIAL LOGIN
======================================== */

.social-login {
  display: flex;
  gap: var(--space-sm);
}

.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-0);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-button);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.btn-social:hover {
  background: var(--color-bg-2);
  border-color: var(--color-accent-soft);
  transform: translateY(-2px);
}

.btn-social svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

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

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

.auth-footer p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.auth-link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.auth-link::after {
  display: none;
}

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

/* ========================================
   MODAL
======================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0% 0 0 / 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s var(--ease-smooth);
}

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

.modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev-2);
  animation: slideUp 0.3s var(--ease-smooth);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border-subtle);
}

.modal-header h2 {
  font-family: var(--font-title);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.modal-close:hover {
  background: var(--color-bg-0);
  color: var(--color-text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: var(--space-lg);
}

.modal-body p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

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

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

  .auth-header h1 {
    font-size: var(--text-lg);
  }

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

  .social-login {
    flex-direction: column;
  }

  .back-home span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-logo {
    animation: none;
  }
}
