/* email-gate.css */
/* Email Gate Modal Styles - Phase 3 Frontend Integration */

/* ============================================ */
/* MODAL CONTAINER */
/* ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================ */
/* MODAL HEADER */
/* ============================================ */

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.modal-subtitle {
  color: #4a5568;
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.5;
}

/* ============================================ */
/* BENEFITS LIST */
/* ============================================ */

.modal-benefits {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
}

.benefit-item:not(:last-child) {
  border-bottom: 1px solid #e2e8f0;
}

.benefit-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}

.benefit-item span:last-child {
  color: #2d3748;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

/* ============================================ */
/* FORM STYLES */
/* ============================================ */

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group input[type="email"] {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
  background: white;
}

.form-group input[type="email"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input[type="email"]::placeholder {
  color: #a0aec0;
}

/* ============================================ */
/* CHECKBOX CONSENT */
/* ============================================ */

.checkbox-group {
  margin-bottom: 1.75rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 400;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #667eea;
}

.checkbox-label span {
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.6;
}

/* ============================================ */
/* SUBMIT BUTTON */
/* ============================================ */

.btn-primary {
  width: 100%;
  padding: 1.125rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================ */
/* PRIVACY NOTE */
/* ============================================ */

.privacy-note {
  text-align: center;
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.privacy-note small {
  color: #718096;
  font-size: 0.85rem;
  line-height: 1.5;
}

.privacy-note a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.privacy-note a:hover {
  text-decoration: underline;
}

/* ============================================ */
/* ERROR MESSAGE */
/* ============================================ */

.error-message {
  background: #fed7d7;
  color: #c53030;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 4px solid #c53030;
  display: none;
  animation: shakeError 0.5s ease;
}

@keyframes shakeError {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* ============================================ */
/* MOBILE RESPONSIVE */
/* ============================================ */

@media (max-width: 640px) {
  .modal {
    padding: 0.5rem;
  }

  .modal-content {
    padding: 2rem 1.5rem;
    border-radius: 12px;
    max-height: 95vh;
  }

  .modal-header h2 {
    font-size: 1.5rem;
  }

  .modal-subtitle {
    font-size: 0.95rem;
  }

  .modal-benefits {
    padding: 1.25rem;
  }

  .benefit-item {
    font-size: 0.9rem;
    padding: 0.75rem 0;
  }

  .benefit-icon {
    font-size: 1.5rem;
  }

  .btn-primary {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .checkbox-label span {
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .modal-header h2 {
    font-size: 1.35rem;
  }

  .benefit-item span:last-child {
    font-size: 0.875rem;
  }
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

/* Focus visible for keyboard navigation */
.btn-primary:focus-visible,
input[type="email"]:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .modal-content,
  .error-message {
    animation: none;
  }

  .btn-primary {
    transition: none;
  }
}
