/*
 * Login & Auth Page Styles
 * Mobile-first: base styles are mobile, min-width scales up
 */

/* Container */
.login-container {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: var(--space-4);
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.login-container--no-animation {
  opacity: 1;
  animation: none;
}

.login-container--no-animation .login-form {
  opacity: 1;
  transform: none;
  animation: none;
}

/* Form Card */
.login-form {
  background: var(--gray-900);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 420px;
  width: 100%;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease-out 0.2s forwards;
}

@media (min-width: 480px) {
  .login-form {
    padding: var(--space-8);
  }
}

@media (min-width: 768px) {
  .login-container {
    padding: var(--space-8);
  }

  .login-form {
    padding: var(--space-12);
  }
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-icon {
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: var(--space-1);
  letter-spacing: -0.025em;
}

@media (min-width: 480px) {
  .login-title {
    font-size: 1.75rem;
  }
}

.login-subtitle {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0;
}

/* Fields */
.login-field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-5);
}

.login-field:last-of-type {
  margin-bottom: var(--space-6);
}

.login-label {
  font-size: 0.8125rem;
  margin-bottom: var(--space-2);
  color: var(--gray-300);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.login-input {
  /* 44px minimum touch target: 16px top/bottom padding + ~15px font = ~47px */
  padding: var(--space-4) var(--space-4);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-md);
  background: var(--gray-1000);
  color: var(--gray-100);
  width: 100%;
  /* 16px prevents iOS zoom on focus */
  font-size: 1rem;
  font-family: "Geist Mono", monospace;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.login-input::placeholder {
  color: var(--gray-600);
}

.login-input:focus {
  outline: none;
  border-color: var(--gray-600);
  background: var(--gray-900);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

@media (min-width: 768px) {
  .login-input {
    padding: var(--space-3) var(--space-4);
    font-size: 0.9375rem;
  }
}

/* Submit Button */
.login-submit {
  /* 44px minimum touch target */
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  background-color: #ffffff;
  color: #000000;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  font-family: "Geist Mono", monospace;
  width: 100%;
  letter-spacing: 0.01em;
  -webkit-appearance: none;
  appearance: none;
}

.login-submit:disabled {
  background-color: var(--gray-800);
  color: var(--gray-600);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Hover effects only for pointer devices (no touch) */
@media (hover: hover) and (pointer: fine) {
  .login-submit:not(:disabled):hover {
    background-color: var(--gray-100);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
  }

  .login-submit:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
  }
}

@media (min-width: 768px) {
  .login-submit {
    font-size: 0.9375rem;
  }
}

/* Footer (forgot password, back links) */
.login-footer {
  text-align: center;
  margin-top: var(--space-6);
}

.login-footer-link {
  font-size: 0.8125rem;
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.15s ease;
  /* 44px touch target via padding */
  padding: var(--space-3) var(--space-4);
  display: inline-block;
}

.login-footer-link:hover {
  color: var(--gray-200);
}

/* Hint text */
.login-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: var(--space-2);
}

/* Auth Section (legacy compat) */
.auth-section {
  background: var(--gray-900);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 480px) {
  .auth-section {
    padding: var(--space-8);
  }
}

@media (min-width: 768px) {
  .auth-section {
    padding: var(--space-12);
  }
}

/* Hero Section (Home Page) */
.hero-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: var(--space-4);
  overscroll-behavior: none;
  touch-action: none;
}

.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeInUp 1.2s ease-out forwards;
}

.hero-signin-button {
  margin-top: 2rem;
  background: linear-gradient(135deg, #ffffff 0%, #e5e5e5 100%);
  color: #000000;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  /* 44px touch target */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeInPulse 1s ease-out 1.8s forwards, heroGlow 2.5s ease-in-out infinite 2.8s;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .hero-signin-button:hover {
    background: linear-gradient(135deg, #f5f5f5 0%, #d4d4d4 100%);
    color: #000000;
    transform: translateY(-1px) scale(1.05);
  }

  .hero-signin-button:active {
    transform: translateY(0) scale(0.98);
  }
}

.hero-description {
  max-width: 500px;
  margin-top: var(--space-8);
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.7;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}

@media (min-width: 480px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-description {
    font-size: 0.9375rem;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 4rem;
  }

  .hero-wrapper {
    position: relative;
    display: inline-block;
  }

  .hero-signin-button {
    position: absolute;
    top: -12px;
    right: -110px;
    margin-top: 0;
  }
}

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

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

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

@keyframes fadeInPulse {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes heroGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  40% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}
