/* ============================================
   LOGIN PAGE
   ============================================ */

/* Reset and Base */
.auth-body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Wrapper and Background */
.login-wrapper {
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.login-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    oklch(99% 0.002 90) 0%,
    oklch(97% 0.008 160) 100%);
  pointer-events: none;
  overflow: hidden;
}

.login-wave {
  position: absolute;
  bottom: -40%;
  left: -10%;
  right: -10%;
  height: 120%;
  background: radial-gradient(ellipse at center top,
    oklch(var(--lch-success) / 0.06) 0%,
    transparent 60%);
  border-radius: 50%;
  animation: wave-pulse 8s ease-in-out infinite;
}

@keyframes wave-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3%) scale(1.02); }
}

/* Container */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Card */
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  animation: slideUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Brand Section */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  animation: logoReveal 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
}

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

.logo-icon {
  width: 48px;
  height: 48px;
}

/* Voice wave animation */
.bar {
  animation: wave 1.5s ease-in-out infinite;
}

.bar-1 {
  animation-delay: 0s;
}

.bar-2 {
  animation-delay: 0.1s;
}

.bar-3 {
  animation-delay: 0.2s;
}

@keyframes wave {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.7);
  }
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Content */
.login-content {
  animation: contentFade 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

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

.login-title {
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 1rem;
  color: var(--ink-60);
  text-align: center;
  margin: 0 0 2rem 0;
  line-height: 1.6;
}

.login-subtitle strong {
  color: var(--ink);
  font-weight: 600;
}

/* Email Sent State */
.email-sent-state {
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--success);
  animation: checkmark 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes checkmark {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.email-instructions {
  background: oklch(var(--lch-primary) / 0.05);
  border: 1px solid oklch(var(--lch-primary) / 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.5rem 0;
}

.email-instructions p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-80);
  line-height: 1.5;
}

.email-tip {
  margin-top: 0.5rem !important;
  font-size: 0.85rem !important;
  color: var(--ink-60) !important;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.login-field {
  position: relative;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-80);
  margin-bottom: 0.5rem;
}

.field-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-50);
  margin-top: 0.5rem;
}

.login-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: white;
  box-sizing: border-box;
}

.login-input:hover {
  border-color: var(--border-dark);
  background: var(--paper);
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow:
    0 0 0 4px oklch(var(--lch-primary) / 0.1),
    0 1px 2px oklch(0% 0 0 / 0.05);
  background: white;
}

/* Button */
.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.login-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, oklch(100% 0 0 / 0.2) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px oklch(var(--lch-success) / 0.3),
    0 8px 24px oklch(var(--lch-primary) / 0.2);
}

.login-button:hover::before {
  opacity: 1;
}

.login-button:active {
  transform: translateY(0);
}

.button-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.login-button:hover .button-arrow {
  transform: translateX(2px);
}

/* Divider */
.login-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.login-divider span {
  font-size: 0.875rem;
  color: var(--ink-50);
  background: var(--surface);
  padding: 0 1rem;
  position: relative;
}

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

/* Actions */
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  width: 100%;
}

.link-button:hover {
  background: oklch(var(--lch-primary) / 0.08);
}

.link-button svg {
  width: 16px;
  height: 16px;
}

/* Alerts */
.login-alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: alertSlide 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.login-alert--success {
  background: var(--success-subtle);
  border: 1px solid oklch(var(--lch-success) / 0.3);
  color: var(--success);
}

.login-alert--error {
  background: var(--danger-subtle);
  border: 1px solid oklch(var(--lch-danger) / 0.3);
  color: var(--danger);
}

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

/* Footer */
.login-footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--ink-40);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer-separator {
  color: var(--ink-20);
}

.footer-link {
  color: var(--ink-50);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* Responsive */
@media (max-width: 640px) {
  .login-card {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-md);
  }

  .login-title {
    font-size: 1.75rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 1.5rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .login-wrapper {
    background: var(--paper);
  }

  .login-card {
    background: var(--surface-raised);
  }

  .login-input {
    background: var(--surface);
    border-color: var(--border-dark);
  }

  .login-input:hover {
    background: var(--surface-raised);
  }

  .login-input:focus {
    background: var(--surface);
  }

  .login-divider span {
    background: var(--surface-raised);
  }

  .email-sent-state .email-instructions {
    background: oklch(var(--lch-primary) / 0.08);
    border-color: oklch(var(--lch-primary) / 0.2);
  }
}
