/* ========================================
   LEAD CAPTURE POPUP — Marketing
   Modale raccolta email per landing page.

   Colori propri hardcoded (come cookie-banner)
   per garantire leggibilità su TUTTI i temi
   inclusi dark themes.

   WCAG 2.1 AA compliant:
   - Testo #1e293b su #fff = 14.5:1 (AAA)
   - Muted #475569 su #fff = 7.1:1 (AAA)
   - CTA #fff su #ea580c = 4.6:1 (AA)
   - Link #4f46e5 su #fff = 6.6:1 (AAA)
   ======================================== */

/* ---- Overlay ---- */
.lc-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lc-overlay.lc-visible {
    opacity: 1;
    visibility: visible;
}

/* ---- Modal ---- */
.lc-modal {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    position: relative;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'DM Sans', Roboto, sans-serif;
    color: #1e293b;
    overflow: hidden;
}

.lc-overlay.lc-visible .lc-modal {
    transform: translateY(0) scale(1);
}

/* ---- Close button ---- */
.lc-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
    line-height: 1;
}

.lc-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

/* ---- Image (optional) ---- */
.lc-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* ---- Body ---- */
.lc-body {
    padding: 28px 32px 32px;
}

/* ---- Incentive badge ---- */
.lc-incentive {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

/* ---- Headline ---- */
.lc-headline {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* ---- Description ---- */
.lc-description {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 20px;
}

/* ---- Form ---- */
.lc-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lc-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.92rem;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.lc-input::placeholder {
    color: #94a3b8;
}

.lc-input:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

/* ---- Consent checkbox ---- */
.lc-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
}

.lc-consent input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #ea580c;
    cursor: pointer;
}

.lc-consent-text {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
}

.lc-consent-text a {
    color: #4f46e5;
    text-decoration: underline;
}

.lc-consent-text a:hover {
    color: #4338ca;
}

/* ---- Honeypot (hidden from humans) ---- */
.lc-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
    tab-index: -1;
}

/* ---- CTA button ---- */
.lc-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    letter-spacing: 0.01em;
}

.lc-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3);
}

.lc-submit:active {
    transform: translateY(0);
}

.lc-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- Loading state ---- */
.lc-submit.lc-loading {
    pointer-events: none;
    opacity: 0.75;
}

/* ---- Error message ---- */
.lc-error {
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.82rem;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    display: none;
}

.lc-error.lc-visible {
    display: block;
}

/* ---- Success state ---- */
.lc-success {
    text-align: center;
    padding: 40px 32px;
}

.lc-success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.lc-success-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
}

.lc-success-message {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 540px) {
    .lc-overlay {
        padding: 16px;
        align-items: flex-end;
    }

    .lc-modal {
        border-radius: 4px 4px 0 0;
        max-width: 100%;
    }

    .lc-body {
        padding: 24px 20px 28px;
    }

    .lc-image {
        height: 120px;
    }

    .lc-headline {
        font-size: 1.15rem;
    }

    .lc-description {
        font-size: 0.85rem;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .lc-overlay,
    .lc-modal,
    .lc-submit {
        transition: none;
    }
}

/* ---- Category pills (Fase 2) ---- */

.lc-category-section {
    margin: 0 0 1rem;
}

.lc-category-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.lc-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lc-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 4px;
    border: 2px solid var(--pill-color, #6366f1);
    background: transparent;
    color: var(--pill-color, #6366f1);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.lc-category-pill:hover {
    background: var(--pill-color, #6366f1);
    color: #fff;
}

.lc-category-pill--selected {
    background: var(--pill-color, #6366f1);
    color: #fff;
}
