/* =========================================================
   LEAD MAGNET : bandeau rouge + pop-up de l'auto-diagnostic
   Le texte du bandeau se change dans lead-magnet.js (bloc LM)
   ========================================================= */

:root {
    --lm-bar-h: 0px;
    --lm-red: #E11D48;
}

/* Le bandeau est fixe en haut : on décale la page et la navbar d'autant */
body {
    padding-top: var(--lm-bar-h);
}

nav {
    top: var(--lm-bar-h);
}

/* ---------- BANDEAU ---------- */
.lm-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: var(--lm-red);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lm-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 3rem;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.lm-bar-tag {
    flex-shrink: 0;
    background: #FBBF24;
    color: #0F172A;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
}

.lm-bar-text {
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.lm-bar-short {
    display: none;
}

.lm-bar-cta {
    flex-shrink: 0;
    background: #fff;
    color: #BE123C;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.lm-bar-inner:hover .lm-bar-cta,
.lm-bar-inner:focus-visible .lm-bar-cta {
    transform: translateX(3px);
}

.lm-bar-close {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: none;
    border: 0;
    color: #fff;
    opacity: 0.8;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.lm-bar-close:hover {
    opacity: 1;
}

@media (max-width: 640px) {
    .lm-bar-inner {
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 0.45rem 2.5rem 0.45rem 0.75rem;
        text-align: left;
    }

    .lm-bar-long {
        display: none;
    }

    .lm-bar-short {
        display: inline;
    }

    .lm-bar-text {
        font-size: 0.8rem;
    }

    .lm-bar-cta {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 380px) {
    .lm-bar-tag {
        display: none;
    }
}

/* ---------- POP-UP ---------- */
html.lm-lock {
    overflow: hidden;
}

.lm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lm-overlay[hidden] {
    display: none;
}

.lm-overlay.lm-in {
    opacity: 1;
}

.lm-modal {
    position: relative;
    width: 100%;
    max-width: 860px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    color: #E2E8F0;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.lm-in .lm-modal {
    transform: none;
}

.lm-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lm-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.lm-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.35), transparent 60%),
        radial-gradient(circle at 80% 90%, rgba(255, 51, 102, 0.3), transparent 55%),
        #111C33;
}

/* La carte des 6 couches, en grisé */
.lm-cover {
    flex-direction: column;
    gap: 1rem;
}

.lm-map {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
}

.lm-map ol {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lm-map li,
.lm-map-side {
    padding: 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
}

.lm-map span {
    display: block;
    margin-bottom: 0.35rem;
    color: #E2E8F0;
    font-size: 0.75rem;
    font-weight: 700;
}

.lm-map li i {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) var(--w), rgba(255, 255, 255, 0.08) var(--w));
}

.lm-map-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.lm-map-side span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin: 0;
}

.lm-map-side i {
    flex: 1;
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.35) 40%, rgba(255, 255, 255, 0.08) 40%);
}

.lm-map-caption {
    margin: 0;
    color: #94A3B8;
    font-size: 0.8rem;
    text-align: center;
}

.lm-body {
    min-width: 0;
    padding: 2.25rem 2.25rem 2rem;
}

.lm-eyebrow {
    margin: 0 0 0.75rem;
    padding-right: 2.5rem;
    color: #FF3366;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lm-body h2 {
    margin: 0 0 0.75rem;
    padding-right: 2rem;
    color: #fff;
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.lm-sub {
    margin: 0 0 1rem;
    color: #CBD5E1;
    font-size: 0.98rem;
    line-height: 1.6;
}

.lm-points {
    display: grid;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.lm-points li {
    position: relative;
    padding-left: 1.5rem;
    color: #E2E8F0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.lm-points li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10B981;
    font-weight: 800;
}

.lm-form {
    display: grid;
    gap: 0.7rem;
}

.lm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.7rem;
}

.lm-field {
    min-width: 0;
}

.lm-field label {
    display: block;
    margin-bottom: 0.3rem;
    color: #CBD5E1;
    font-size: 0.78rem;
    font-weight: 600;
}

.lm-form input,
.lm-form select {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.6rem;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lm-form select option {
    color: #0F172A;
}

.lm-form input:focus,
.lm-form select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.lm-form [aria-invalid="true"] {
    border-color: #FF3366;
}

.lm-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.lm-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: 1rem 1.5rem;
    border: 0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #2563EB, #FF3366);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lm-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 51, 102, 0.4);
}

.lm-submit[disabled] {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.lm-error {
    margin: 0;
    color: #FDA4AF;
    font-size: 0.88rem;
}

.lm-error:empty {
    display: none;
}

.lm-legal {
    margin: 0.25rem 0 0;
    color: #94A3B8;
    font-size: 0.75rem;
    line-height: 1.5;
}

.lm-legal a {
    color: #CBD5E1;
}

.lm-success[hidden] {
    display: none;
}

.lm-success p {
    margin: 0 0 1.25rem;
    color: #CBD5E1;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .lm-modal {
        grid-template-columns: minmax(0, 1fr);
    }

    .lm-cover {
        padding: 1.5rem 1.5rem 0;
        background: none;
    }

    .lm-map {
        max-width: 240px;
    }
}

/* Mobile : la pop-up devient un panneau qui monte du bas */
@media (max-width: 600px) {
    .lm-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .lm-modal {
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 1rem 1rem 0 0;
    }

    /* Le formulaire et son bouton doivent tenir dans l'écran sans défiler */
    .lm-cover,
    .lm-points {
        display: none;
    }

    .lm-body {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .lm-eyebrow {
        margin-bottom: 0.5rem;
    }

    .lm-body h2 {
        font-size: 1.2rem;
    }

    .lm-sub {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .lm-form {
        gap: 0.55rem;
    }

    .lm-form input,
    .lm-form select {
        padding: 0.65rem 0.8rem;
    }

    .lm-submit {
        padding: 0.9rem 1.25rem;
    }

    .lm-row {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Les deux listes restent côte à côte pour garder le bouton visible */
    .lm-row-selects {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    }

    .lm-row-selects select {
        padding-left: 0.6rem;
        padding-right: 0.3rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .lm-row-selects select {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lm-overlay,
    .lm-modal,
    .lm-submit,
    .lm-bar-cta {
        transition: none;
    }
}
