/**
 * funnel.css — modal + form styles for the AI Agency MSL Engine funnel.
 * Used on /, /upsell, /downsell, /upsell2, /downsell2, /thanks.
 *
 * Designed to work over BOTH dark (black) and light (white) page themes.
 * The modal itself is dark by default. Buttons inherit the funnel's neon-green accent.
 */

.funnel-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fnlFadeIn 0.2s ease;
}
.funnel-modal-backdrop.open {
  display: flex;
}
@keyframes fnlFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.funnel-modal {
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(55, 202, 55, 0.15);
  animation: fnlSlideUp 0.25s ease;
  font-family: "Inter", "Open Sans", system-ui, -apple-system, sans-serif;
}
@keyframes fnlSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.funnel-form {
  padding: 32px 28px;
  position: relative;
  color: #fff;
}

.funnel-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.15s;
}
.funnel-close:hover { color: #fff; }

.funnel-h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: #fff;
}
.funnel-sub {
  font-size: 14px;
  color: #a1a1aa;
  margin-bottom: 22px;
  font-style: italic;
}

.funnel-input {
  display: block;
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #fff;
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.funnel-input:focus {
  outline: none;
  border-color: #4ade80;
}
.funnel-input::placeholder {
  color: #555;
}

.funnel-btn {
  display: block;
  width: 100%;
  background: #37ca37;
  color: #fff;
  border: none;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 8px;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.06s;
  box-shadow: 0 4px 0 #1f8b1f, 0 6px 16px rgba(55, 202, 55, 0.25);
}
.funnel-btn:hover { background: #4ade80; }
.funnel-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1f8b1f; }
.funnel-btn:disabled {
  background: #2a4a2a;
  cursor: not-allowed;
  box-shadow: none;
}

.funnel-btn-secondary {
  display: block;
  width: 100%;
  background: transparent;
  color: #a1a1aa;
  border: 1px solid #2a2a2a;
  padding: 12px 18px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  margin-top: 8px;
}
.funnel-btn-secondary:hover { border-color: #444; color: #fff; }

.funnel-fine {
  font-size: 12px;
  color: #888;
  margin-top: 14px;
  line-height: 1.5;
  text-align: center;
}
.funnel-fine strong { color: #ccc; }

.funnel-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 14px;
}

.funnel-payment-mount {
  margin-bottom: 14px;
}

.funnel-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #1a1a1a;
  border-top-color: #4ade80;
  border-radius: 50%;
  margin: 24px auto;
  animation: fnlSpin 0.8s linear infinite;
}
@keyframes fnlSpin {
  to { transform: rotate(360deg); }
}

/* Success / redirecting modal */
.funnel-success-form { text-align: center; padding-top: 40px; padding-bottom: 40px; }
.funnel-success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #1f8b1f;
  color: #fff;
  font-size: 36px;
  font-weight: 900;
  line-height: 64px;
  margin: 0 auto 18px;
  box-shadow: 0 0 0 6px rgba(55, 202, 55, 0.18);
  animation: fnlPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fnlPop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.funnel-success-sub {
  font-size: 14px;
  color: #71717a;
  margin-top: 18px;
}
.funnel-success-dots::after {
  content: '';
  animation: fnlDots 1.2s steps(4, end) infinite;
}
@keyframes fnlDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* Animated step list inside success modal */
.funnel-steps {
  text-align: left;
  margin: 24px auto 4px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.funnel-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #52525b;
  opacity: 0.5;
  transition: color 0.25s, opacity 0.25s;
}
.funnel-step.is-active { color: #d4d4d8; opacity: 1; }
.funnel-step.is-done   { color: #4ade80; opacity: 1; }
.funnel-step-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #2a2a2a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.funnel-step.is-active .funnel-step-icon {
  border-color: #4ade80;
  position: relative;
}
.funnel-step.is-active .funnel-step-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #4ade80;
  animation: fnlSpin 0.8s linear infinite;
}
.funnel-step.is-done .funnel-step-icon {
  border-color: #1f8b1f;
  background: #1f8b1f;
  color: #fff;
}
.funnel-step.is-done .funnel-step-icon::after {
  content: '✓';
}
.funnel-step-text { flex: 1; }

.funnel-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  padding: 18px 22px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.funnel-confirm-label {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.funnel-confirm-amount {
  font-size: 24px;
  font-weight: 900;
  color: #4ade80;
}
.funnel-confirm-card {
  background: #1a1a1a;
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 15px;
  color: #ccc;
}

/* Banner shown on upsell pages: "Your toolkit downloads on the final page →" */
.funnel-pending-banner {
  background: #fde047;
  color: #000;
  text-align: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.funnel-pending-banner strong { font-weight: 900; }

/* Thanks page download rows */
.funnel-download-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafdf5;
  border-left: 4px solid #1f8b1f;
  padding: 16px 22px;
  margin-bottom: 10px;
  border-radius: 4px;
  gap: 16px;
}
.funnel-download-label {
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.funnel-download-row .funnel-btn {
  width: auto;
  margin: 0;
  padding: 10px 18px;
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .funnel-form { padding: 24px 20px; }
  .funnel-h2 { font-size: 19px; }
  .funnel-confirm-row { flex-direction: column; gap: 8px; align-items: flex-start; }
  .funnel-download-row { flex-direction: column; align-items: stretch; }
  .funnel-download-row .funnel-btn { width: 100%; }
}
