/* ===== AUTH LAYOUT (shared by signup.html + login.html) ===== */
.auth-wrapper {
  display: flex;
  /* iOS Safari includes the URL bar in 100vh, leading to overflow.
     -webkit-fill-available gives the actual visible viewport on iOS;
     100svh handles modern browsers; 100vh is the desktop fallback. */
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100svh;
}

.auth-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.auth-brand-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow-strong) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.auth-brand-content.center {
  text-align: center;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 48px;
}

.auth-brand-content.center .auth-brand-logo {
  justify-content: center;
  margin-bottom: 40px;
}

.auth-brand-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 36px;
}

.auth-brand-content.center .auth-brand-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.auth-brand-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.benefit-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  border: 1px solid rgba(187, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefit-text h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.benefit-text p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 24px;
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
}

.auth-form-header {
  margin-bottom: 32px;
}

.auth-form-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-form-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.auth-form-header .tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--accent-light);
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font);
  /* 16px (1rem) prevents iOS Safari's auto-zoom on focus.
     Anything below 16px triggers a zoom that users almost never want. */
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error {
  font-size: 0.8125rem;
  color: #EF4444;
  margin-top: 6px;
  display: none;
}

.form-error.visible {
  display: block;
}

.auth-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: none;
}

.auth-alert.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #DC2626;
}

.auth-alert.success {
  display: block;
  background: rgba(40, 200, 64, 0.1);
  border: 1px solid rgba(40, 200, 64, 0.3);
  color: #059669;
}

.form-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--accent-light);
  font-weight: 600;
}

.form-footer a:hover {
  color: var(--accent);
}

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

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
  }

  .auth-brand {
    padding: 48px 24px 40px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .auth-brand-title {
    font-size: 1.5rem;
  }

  .auth-brand-content.center .auth-brand-title {
    font-size: 1.75rem;
  }

  .auth-form-side {
    padding: 40px 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
