/* Newsletter funnel — visual styling adapted from the designer's
   survey-modal.css. Applied to the standardized .quiz-step / .nl-*
   class names. All rules are scoped to .nl-funnel (or body.newsletter-
   funnel-active) so quiz1 / quiz2 styling is unaffected. Step 8
   (plan select) is intentionally left to quiz1's .sell-* + .signup-*
   chassis from quiz/assets/style.css — see comments below. */

/* ── Funnel reveal ─────────────────────────────────────────────────── */
body.newsletter-funnel-active .nw-hero,
body.newsletter-funnel-active .nw-articles-section,
body.newsletter-funnel-active .nw-issue-section,
body.newsletter-funnel-active .nw-stats-section,
body.newsletter-funnel-active .nw-cta-section,
body.newsletter-funnel-active .site-footer-new,
body.newsletter-funnel-active #backToTop {
    display: none !important;
}

/* ── Outer flow container (centered card, ample whitespace) ───────── */
.nl-funnel {
    padding: 32px 0 80px;
    animation: nlFlowFadeIn 0.5s ease;
    font-family: 'Poppins', sans-serif;
}
@keyframes nlFlowFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Top-of-funnel progress bar (fixed) */
.nl-funnel .quiz-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    height: 4px;
    background: #e2e8f0;
    border-radius: 0;
    overflow: hidden;
}
.nl-funnel .quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #6366F1);
    border-radius: 0;
    transition: width 0.5s cubic-bezier(.16,1,.3,1);
}

/* Funnel shell — outer container width. Matches designer's 900px card. */
.newsletter-funnel-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}
@media (max-width: 720px) {
    .newsletter-funnel-shell { padding: 0 4px; }
}

/* Step is the outer animation wrapper — NO card chassis here (heading sits
   outside the card visually). The card lives on .nl-step-body. */
.nl-funnel .quiz-step {
    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    animation: nlStepFadeIn 0.35s ease;
    position: static;
    transform: none;
    opacity: 1;
}
.nl-funnel .quiz-step.active { display: block; }
@keyframes nlStepFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Step heading sits ABOVE the card — bold dark text with a blue gradient
   on the <span> highlight portion. Mirrors the designer's external title. */
.nl-funnel .quiz-step > .quiz-question {
    font-family: 'Poppins', sans-serif;
    font-size: 38px;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    letter-spacing: -1.5px;
    text-align: center;
    margin: 0 auto 28px;
    max-width: 720px;
    display: block;
    padding: 0 12px;
}
.nl-funnel .quiz-step > .quiz-question span {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
@media (max-width: 720px) {
    .nl-funnel .quiz-step > .quiz-question {
        font-size: 28px;
        letter-spacing: -1px;
        line-height: 1.2;
    }
}

/* The actual card — wraps everything after the heading inside each step. */
.nl-funnel .nl-step-body {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.06);
    padding: 36px 36px 40px;
}
@media (max-width: 720px) {
    .nl-funnel .nl-step-body {
        padding: 20px 10px 24px;
        border-radius: 16px;
    }
}

/* Compact the chart on narrow viewports so it fits inside the card on
   iPhone 12 Pro (390px) and similar. Quiz1/2's @480 chassis still leaves
   the last bar overflowing once you account for the card's inner padding. */
@media (max-width: 480px) {
    .nl-funnel .growth-chart    { gap: 6px; padding: 18px 8px 12px; }
    .nl-funnel .chart-y-axis    { min-width: 22px; font-size: 11px; padding-bottom: 28px; }
    .nl-funnel .chart-bars      { padding-left: 6px; gap: 6px; }
    .nl-funnel .chart-bar       { width: 34px; }
    .nl-funnel .chart-bar-group { max-width: none; min-width: 0; flex: 1 1 0; }
    .nl-funnel .chart-bubble    { font-size: 10px; padding: 3px 8px; }
}

/* Sub-heading inside the card body. */
.nl-funnel .nl-step-body .quiz-question-sub {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin: 0 auto 22px;
}

/* ── Single-select options (steps 0, 1, 2, 4) ─────────────────────── */
.nl-funnel .quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}
.nl-funnel .quiz-option,
.nl-funnel .quiz-option-img {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px 20px !important;
    min-height: 0 !important;
    height: auto !important;
    border: 1px solid #BFDBFE !important;
    border-radius: 12px !important;
    background: #fff !important;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    line-height: 1.4;
    /* Override quiz1's option icon layout — newsletter options are text-only pills */
}
.nl-funnel .quiz-option .quiz-option-icon { display: none; }
.nl-funnel .quiz-option .quiz-option-text {
    font-weight: 500;
    color: inherit;
}
.nl-funnel .quiz-option:hover,
.nl-funnel .quiz-option-img:hover {
    border-color: #3B82F6 !important;
    background: #F0F7FF !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15) !important;
}
.nl-funnel .quiz-option.selected,
.nl-funnel .quiz-option-img.selected {
    border-color: #3B82F6 !important;
    background: #EFF6FF !important;
    color: #1D4ED8 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* ── Multi-select tools grid (step 3) ─────────────────────────────── */
.nl-funnel .nl-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 20px;
}
@media (max-width: 600px) {
    .nl-funnel .nl-tools-grid { grid-template-columns: repeat(2, 1fr); }
}
.nl-funnel .nl-tool-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-align: left;
    flex-direction: row;
    justify-content: flex-start;
}
.nl-funnel .nl-tool-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.nl-funnel .nl-tool-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.nl-funnel .nl-tool-icon-img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: contain;
}
.nl-funnel .nl-tool-none {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* Continue + back row — full card width, stacked vertically. */
.nl-funnel .nl-nav-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 24px 0 0;
}
.nl-funnel .nl-continue-btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: #94a3b8;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 1;
    pointer-events: auto;
}
.nl-funnel .nl-continue-btn.enabled {
    background: #3B82F6;
}
.nl-funnel .nl-continue-btn.enabled:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}
.nl-funnel .nl-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.nl-funnel .nl-back-btn:hover {
    border-color: #cbd5e1;
    color: #334155;
}

/* ── Result type card (step 5) ────────────────────────────────────── */
.nl-funnel .nl-result-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
    border: 1.5px solid #e2e8f0;
}
.nl-funnel .nl-result-text { flex: 1; min-width: 0; }
.nl-funnel .nl-result-label {
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6;
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}
.nl-funnel .nl-result-type {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.nl-funnel .nl-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.nl-funnel .nl-result-tags span {
    padding: 5px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    background: transparent;
}
.nl-funnel .nl-result-stat {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 10px;
}
.nl-funnel .nl-result-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.55;
}
.nl-funnel .nl-result-mascot {
    width: 130px;
    flex-shrink: 0;
}
.nl-funnel .nl-result-mascot img {
    width: 100%;
    height: auto;
    display: block;
}
@media (max-width: 600px) {
    .nl-funnel .nl-result-card { flex-direction: column; align-items: center; text-align: center; }
    .nl-funnel .nl-result-tags { justify-content: center; }
    .nl-funnel .nl-result-mascot { width: 100px; }
}
.nl-funnel .nl-result-footer {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 16px 0;
}

/* ── CTA buttons on steps 5/6/7 (use .sell-cta-btn class but flatter) ── */
/* Step 8 (plan select) keeps quiz1's .sell-cta-btn treatment — left untouched. */
.nl-funnel .quiz-step[data-step="5"] .sell-cta-btn,
.nl-funnel .quiz-step[data-step="6"] .sell-cta-btn,
.nl-funnel .quiz-step[data-step="7"] .sell-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 24px 0 0;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: #3B82F6;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
}
.nl-funnel .quiz-step[data-step="5"] .sell-cta-btn:hover,
.nl-funnel .quiz-step[data-step="6"] .sell-cta-btn:hover,
.nl-funnel .quiz-step[data-step="7"] .sell-cta-btn:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

/* ── Step 6 — processing spinner + profile gauge ──────────────────── */
.nl-funnel .step-processing {
    text-align: center;
    padding: 24px 0;
}
.nl-funnel .step-processing .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #3B82F6;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: nlSpin 1s linear infinite;
}
@keyframes nlSpin { to { transform: rotate(360deg); } }

/* ── Step 7 — growth chart axis labels + bar layout ───────────────── */
.nl-funnel .growth-target {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #2563EB;
    margin: 0 0 16px;
}
.nl-funnel .growth-goal-badge {
    display: inline-block;
    padding: 6px 16px;
    background: #EFF6FF;
    color: #3B82F6;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    margin: 0 auto 24px;
}
.nl-funnel .growth-goal-badge { display: block; width: max-content; }
.nl-funnel .growth-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 12px 0 0;
    font-style: italic;
}

/* ── Step 8 (plan select) — DO NOT override here. ─────────────────────
   Step 8 uses .sell-plan, .signup-checkbox, .signup-consent, and
   .sell-cta-btn (without data-step constraint) — all rendered by
   quiz/assets/style.css. Keep that visual treatment consistent across
   quiz1 / quiz2 / newsletter so the legal block + CTA + plan cards
   look identical on the conversion step. */

/* ── Responsive tweaks ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .nl-funnel .quiz-step { padding: 28px 0 32px; border-radius: 16px; }
    .nl-funnel .quiz-step .quiz-question { font-size: 22px; margin-bottom: 22px; }
    .nl-funnel .nl-result-type { font-size: 26px; }
}
