/* ==========================================================================
   Universal Lightweight Email Capture Component Styles
   The Maths and Science Tutor
   ========================================================================== */

.email-capture-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.email-capture-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
}

.email-capture-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 28px -4px rgba(15, 23, 42, 0.09);
}

.email-capture-card.dark-theme,
.dark-theme .email-capture-card,
[data-theme="dark"] .email-capture-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-color: #334155;
  color: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.email-capture-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.email-capture-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.dark-theme .email-capture-icon,
[data-theme="dark"] .email-capture-icon {
  background: #312e81;
  color: #a5b4fc;
}

.email-capture-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.dark-theme .email-capture-title,
[data-theme="dark"] .email-capture-title {
  color: #f8fafc;
}

.email-capture-desc {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.dark-theme .email-capture-desc,
[data-theme="dark"] .email-capture-desc {
  color: #94a3b8;
}

/* Form layout */
.email-capture-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-capture-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.email-capture-input-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.email-capture-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.email-capture-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.email-capture-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.dark-theme .email-capture-input,
[data-theme="dark"] .email-capture-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.dark-theme .email-capture-input:focus,
[data-theme="dark"] .email-capture-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.email-capture-btn {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.email-capture-btn:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.email-capture-btn:active {
  transform: translateY(0);
}

.email-capture-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Secondary / compact option */
.email-capture-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
}

.email-capture-privacy i {
  color: #10b981;
}

/* Error message */
.email-capture-error {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
  display: none;
}

.email-capture-error.show {
  display: block;
  animation: ecFadeIn 0.2s ease;
}

/* Success State */
.email-capture-success {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: ecFadeIn 0.3s ease;
}

.dark-theme .email-capture-success,
[data-theme="dark"] .email-capture-success {
  background: rgba(22, 101, 52, 0.2);
  border-color: #15803d;
}

.email-capture-success-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #22c55e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.email-capture-success-text h4 {
  margin: 0 0 2px 0;
  font-size: 1rem;
  font-weight: 700;
  color: #166534;
}

.dark-theme .email-capture-success-text h4,
[data-theme="dark"] .email-capture-success-text h4 {
  color: #86efac;
}

.email-capture-success-text p {
  margin: 0;
  font-size: 0.88rem;
  color: #15803d;
}

.dark-theme .email-capture-success-text p,
[data-theme="dark"] .email-capture-success-text p {
  color: #bbf7d0;
}

/* Compact variant (for embedding directly inside results panels) */
.email-capture-card.compact {
  padding: 18px;
  border-radius: 12px;
  margin: 16px 0;
}

.email-capture-card.compact .email-capture-icon {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.email-capture-card.compact .email-capture-title {
  font-size: 1.05rem;
}

.email-capture-card.compact .email-capture-desc {
  font-size: 0.88rem;
}

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

@media (max-width: 640px) {
  .email-capture-card {
    padding: 18px 16px;
  }
  .email-capture-row {
    flex-direction: column;
  }
  .email-capture-btn {
    width: 100%;
  }
}
