/* ============================================================
   CrunchyNews — Landing Page
   Sleek, modern, conversion-focused design
   ============================================================ */

:root {
    --bg:          #08090e;
    --bg-surface:  #12141c;
    --bg-elevated: #1a1d28;
    --border:      rgba(255, 255, 255, 0.07);
    --border-hover:rgba(255, 255, 255, 0.14);

    --text:        #f0f0f5;
    --text-secondary: #9197a6;
    --text-muted:  #5c6272;

    --accent:      #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.18);
    --accent-hover:#2563eb;

    --success:     #22c55e;
    --error:       #ef4444;

    --radius:      10px;
    --radius-lg:   16px;
    --transition:  180ms ease;

    /* Borough palette */
    --manhattan:    #3b82f6;
    --brooklyn:     #8b5cf6;
    --queens:       #f59e0b;
    --bronx:        #ef4444;
    --statenisland: #10b981;
    --allnyc:       #64748b;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Page Container ────────────────────────────────────────────────────── */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Nav ───────────────────────────────────────────────────────────────── */

.nav {
    padding: 28px 0;
    text-align: center;
}

.nav-logo, .footer-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.nav-logo span, .footer-logo span {
    color: var(--accent);
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 60px 0 48px;
}

.hero-headline {
    font-size: clamp(38px, 7vw, 56px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--text);
}

.hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

/* ─── Signup Form ───────────────────────────────────────────────────────── */

.signup-form {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.email-row {
    display: flex;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.email-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.email-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.email-input::placeholder {
    color: var(--text-muted);
}

.email-input.input-error {
    color: var(--error);
}

.subscribe-btn {
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.subscribe-btn:hover {
    background: var(--accent-hover);
}

.subscribe-btn:active {
    transform: scale(0.97);
}

.subscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Editions ──────────────────────────────────────────────────────────── */

.editions {
    margin-top: 28px;
}

.editions-hint {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 12px;
}

.edition-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Every button: one style */
.ed {
    padding: 12px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    user-select: none;
    white-space: nowrap;
}

.ed:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--bg-surface);
}

/* All NYC spans full width */
.ed--all {
    grid-column: 1 / -1;
    font-size: 15px;
    padding: 14px 10px;
    letter-spacing: -0.2px;
}

/* Active states */
.ed.active {
    color: #fff;
    border-color: transparent;
}

.ed--all.active {
    background: var(--accent);
}
.ed--all.active:hover {
    background: var(--accent-hover);
}

.ed[data-borough="Manhattan"].active { background: var(--manhattan); }
.ed[data-borough="Brooklyn"].active  { background: var(--brooklyn); }
.ed[data-borough="Queens"].active    { background: var(--queens); color: #1a1d28; }
.ed[data-borough="Bronx"].active     { background: var(--bronx); }
.ed[data-borough="Staten Island"].active { background: var(--statenisland); }

.ed--good.active {
    background: var(--success);
}
.ed--good.active:hover {
    background: #1aab4e;
}

/* ─── Form Messages ─────────────────────────────────────────────────────── */

.form-message {
    margin-top: 8px;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

.form-message.message-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--success);
}

.form-message.message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--error);
}

/* ─── Partner Referral Popup ───────────────────────────────────────────── */

.partner-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: popupFadeIn 0.25s ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.partner-popup {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px 24px;
    max-width: 680px;
    width: 100%;
    text-align: center;
    animation: popupSlideUp 0.3s ease;
    position: relative;
}

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

.partner-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.partner-popup-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.partner-popup-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.partner-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    text-align: left;
    transition: border-color var(--transition);
    position: relative;
    overflow: visible;
}

.partner-card:nth-child(2) { border-left-color: var(--success); }
.partner-card:nth-child(3) { border-left-color: var(--queens); }
.partner-card:nth-child(4) { border-left-color: var(--brooklyn); }
.partner-card:nth-child(5) { border-left-color: var(--bronx); }

.partner-card:hover {
    border-color: var(--border-hover);
}

.partner-card-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.partner-card-info strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.partner-card-info small {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.partner-card-btn {
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.partner-card-btn:hover {
    background: var(--accent-hover);
}

.partner-card-btn:active {
    transform: scale(0.96);
}

.partner-card-btn.subscribed {
    background: var(--success);
    cursor: default;
    pointer-events: none;
}

.partner-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    padding: 0;
}

.partner-popup-close:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

/* partner-popup-dismiss removed — popup closes via X or overlay click */

/* ─── Confetti Burst ──────────────────────────────────────────────────── */

.confetti-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    pointer-events: none;
    z-index: 1001;
    animation: confettiBurst 0.6s ease-out forwards;
}

@keyframes confettiBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--cx), var(--cy)) rotate(var(--cr)) scale(0.4);
    }
}

/* ─── Referral Banner ──────────────────────────────────────────────────── */

.referral-banner {
    text-align: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius);
    margin-top: 8px;
    animation: bannerFadeIn 0.4s ease;
}

@keyframes bannerFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Welcome Screen — Header ────────────────────────────────────────── */

.welcome-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

.welcome-check {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.35);
    animation: checkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.welcome-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

/* ─── Welcome Screen — Share Section ──────────────────────────────────── */

.welcome-share-section {
    margin-bottom: 20px;
}

.welcome-share-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
}

.welcome-share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.welcome-share-url {
    display: flex;
    gap: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    flex: 1;
    min-width: 0;
}

.share-url-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', monospace;
    outline: none;
    cursor: text;
    user-select: all;
    letter-spacing: -0.2px;
}

.share-url-copy {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.share-url-copy:hover {
    background: var(--accent-hover);
}

.share-url-copy:active {
    transform: scale(0.95);
}

.share-url-copy.copied {
    background: var(--success);
}

.share-url-mail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 19px;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    flex-shrink: 0;
}

.share-url-mail:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ─── Welcome Screen — Progress Tracker (Domino's style) ─────────────── */

.welcome-progress {
    margin-bottom: 24px;
    padding: 18px 20px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.welcome-progress-steps {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin: 0 0 12px 0;
    padding: 0;
    height: 40px;
}

/* The connecting track line behind the dots */
.welcome-progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 14px;
    right: 14px;
    height: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 0;
}

/* The filled portion of the track */
.welcome-progress-bar {
    position: absolute;
    top: 50%;
    left: 14px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #60a5fa);
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 1;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
    width: 0;
}

/* Individual step dots */
.welcome-progress-dot {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 2;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.welcome-progress-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
    transform: scale(1.1);
}

.welcome-progress-dot.complete {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* Milestone dot (the gift card at the end) */
.welcome-progress-dot.milestone {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 16px;
}

.welcome-progress-headline {
    font-size: 15px;
    color: var(--text);
    text-align: center;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.welcome-progress-headline strong {
    color: var(--success);
}

.welcome-progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
    margin: 0;
}

.welcome-progress-label strong {
    color: var(--accent);
}

.welcome-terms-link {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 6px;
    transition: color var(--transition);
}

.welcome-terms-link:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* ─── Welcome Screen — Partner Bonus Section ─────────────────────────── */

.welcome-partner-section {
    margin-bottom: 16px;
    padding: 18px 16px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.welcome-partner-header {
    text-align: center;
    margin-bottom: 14px;
}

.welcome-partner-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.welcome-partner-hint {
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

/* ─── Legal ─────────────────────────────────────────────────────────────── */

.legal-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
}

/* ─── Value Props ───────────────────────────────────────────────────────── */

.value-props {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.prop {
    text-align: center;
}

.prop-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text);
}

.prop-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.prop-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ─── How It Works ──────────────────────────────────────────────────────── */

.how-it-works {
    padding: 56px 0;
    max-width: 480px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 36px;
    color: var(--text);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition);
}

.step:hover {
    border-color: var(--border-hover);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.step-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: var(--text-secondary);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .hero {
        padding: 40px 0 36px;
    }

    .hero-headline {
        font-size: 34px;
        letter-spacing: -1.5px;
    }

    .hero-sub {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .email-row {
        flex-direction: column;
        gap: 0;
    }

    .email-input {
        padding: 14px 16px;
    }

    .subscribe-btn {
        width: 100%;
        padding: 14px;
        border-radius: 8px;
    }

    .ed {
        padding: 11px 8px;
        font-size: 13px;
    }

    .ed--all {
        font-size: 14px;
        padding: 13px 8px;
    }

    .value-props {
        gap: 20px;
    }

    .prop-num {
        font-size: 22px;
    }

    .step {
        padding: 16px 18px;
    }

    /* Welcome popup: constrain on mobile */
    .partner-popup {
        max-width: 480px;
        padding: 24px 20px 20px;
    }
}

@media (max-width: 380px) {
    .page {
        padding: 0 16px;
    }

    .hero-headline {
        font-size: 28px;
    }

    .value-props {
        flex-direction: column;
        gap: 16px;
    }

    .prop-divider {
        width: 40px;
        height: 1px;
    }
}
