/* ============================================
   Email Gate Modal — Glassmorphism
   ============================================ */

.email-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-slow) var(--ease-default);
}

.email-gate-overlay.active {
  opacity: 1;
  visibility: visible;
}

.email-gate {
  width: 100%;
  max-width: 440px;
  padding: var(--space-xl);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  transform: translateY(20px);
  transition: transform var(--duration-slow) var(--ease-default);
}

.email-gate-overlay.active .email-gate {
  transform: translateY(0);
}

.email-gate h3 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.email-gate p {
  text-align: center;
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
}

/* ── Form ── */
.email-gate-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.email-gate-input {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-default);
}

.email-gate-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.email-gate-input.error {
  border-color: var(--glow-risk);
}

.email-gate-error {
  font-size: 0.8125rem;
  color: var(--glow-risk);
  display: none;
}

.email-gate-error.visible {
  display: block;
}

.email-gate-submit {
  width: 100%;
  padding: 14px;
  font-size: 0.9375rem;
  justify-content: center;
}

/* ── Privacy ── */
.email-gate-privacy {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Close ── */
.email-gate-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: all var(--duration-fast) var(--ease-default);
}

.email-gate-close:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ── Success State ── */
.email-gate.success .email-gate-form {
  display: none;
}

.email-gate-success {
  display: none;
  text-align: center;
  padding: var(--space-lg) 0;
}

.email-gate.success .email-gate-success {
  display: block;
}

.email-gate-success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.15);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent);
  animation: pulse-success 0.6s ease-out;
}

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

@media (max-width: 768px) {
  .email-gate {
    margin: var(--space-md);
    padding: var(--space-lg);
  }
}
