/**
 * Authentication Pages Styles
 * Matches Vibepeak brand: dark theme, gradient accents, modern UI
 */

/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Login page container */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #020617 50%, #1e1b4b 100%);
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

/* Animated background elements */
.auth-container::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.15) 0%,
    transparent 70%
  );
  top: -250px;
  right: -100px;
  border-radius: 50%;
  animation: pulse 4s ease-in-out infinite;
}

.auth-container::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(236, 72, 153, 0.1) 0%,
    transparent 70%
  );
  bottom: -200px;
  left: -100px;
  border-radius: 50%;
  animation: pulse 6s ease-in-out infinite reverse;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.4;
  }
}

/* Login card */
.auth-card {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.5rem;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 30px 60px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Logo container */
.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo img {
  height: 56px;
  width: auto;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.3));
  transition: transform 0.3s ease;
}

.auth-logo img:hover {
  transform: scale(1.05);
}

.auth-logo h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.025em;
}

.auth-logo p {
  font-size: 0.9375rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0;
  opacity: 0.9;
}

/* Form elements */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.01em;
  margin-bottom: 0.125rem;
}

.form-input {
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
  color: #8b5cf6;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.form-input:focus {
  outline: none;
  border-color: #8b5cf6;
  background: rgba(30, 41, 59, 0.8);
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: #64748b;
  opacity: 0.7;
}

/* Submit button */
.auth-button {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
  box-shadow:
    0 4px 12px rgba(139, 92, 246, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.015em;
}

.auth-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.5s ease;
}

.auth-button:hover:not(:disabled)::before {
  left: 100%;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 8px 20px rgba(139, 92, 246, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
}

.auth-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(139, 92, 246, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

.auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading state */
.auth-button.loading {
  color: transparent;
}

.auth-button.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid white;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

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

/* Error message */
.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.75rem;
  padding: 0.875rem 1.125rem;
  color: #fca5a5;
  font-size: 0.875rem;
  display: none;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.auth-error.show {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-error.show::before {
  content: "⚠";
  font-size: 1.125rem;
  flex-shrink: 0;
}

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

/* Footer */
.auth-footer {
  margin-top: 2.5rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-footer p {
  margin: 0;
  opacity: 0.8;
}

.auth-footer a {
  color: #8b5cf6;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.auth-footer a:hover {
  color: #a78bfa;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-card {
    padding: 2.5rem 1.75rem;
  }

  .auth-logo h1 {
    font-size: 1.75rem;
  }

  .auth-logo img {
    height: 48px;
  }

  .form-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 360px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }

  .auth-logo h1 {
    font-size: 1.5rem;
  }
}

/* Loading screen for dashboard authentication check */
.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #020617;
  color: #94a3b8;
}

.auth-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
