/* ============================================
   Modal Lead Capture — Compact & Scrollable
   ============================================ */

.ei-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 99999;
    align-items: flex-start; /* pour scroll si besoin */
    justify-content: center;
    padding: 20px 10px;
    overflow-y: auto;
    animation: ei-modal-fade .2s ease;
}
.ei-modal-overlay.open { display: flex; }
@keyframes ei-modal-fade { from { opacity: 0; } to { opacity: 1; } }

.ei-modal {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    max-width: 460px;
    width: 100%;
    margin: auto 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: ei-modal-slide .25s ease;
    position: relative;
    /* Scroll interne si le modal dépasse la hauteur de l'écran */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@keyframes ei-modal-slide {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Scrollbar discrète (Chrome/Safari) */
.ei-modal::-webkit-scrollbar { width: 6px; }
.ei-modal::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.ei-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    color: #6b7280;
    z-index: 2;
}
.ei-modal-close:hover { background: #e5e7eb; color: #111827; }

.ei-modal-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 12px;
    color: #fff;
}

.ei-modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #111827;
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.25;
}

.ei-modal-subtitle {
    font-size: .82rem;
    color: #6b7280;
    text-align: center;
    margin: 0 0 14px;
    line-height: 1.45;
}

/* Aperçu prix compact */
.ei-modal-preview {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
    margin-bottom: 14px;
}
.ei-modal-preview-label {
    font-size: .72rem;
    color: #4b5563;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ei-modal-preview-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e40af;
    margin-top: 2px;
    line-height: 1.2;
}

/* Bénéfices — liste compacte 2 colonnes sur desktop */
.ei-modal-benefits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
}
.ei-modal-benefit {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: .78rem;
    color: #374151;
    line-height: 1.35;
}
.ei-modal-benefit-icon {
    font-size: .9rem;
    flex-shrink: 0;
    line-height: 1.35;
}

/* Formulaire compact */
.ei-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ei-modal-form .ei-form-group { margin: 0; }
.ei-modal-form .ei-label {
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: #374151;
}
.ei-modal-form .ei-input,
.ei-modal-form .ei-select {
    padding: 8px 10px;
    font-size: .88rem;
    border-radius: 8px;
}
.ei-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Toggles compactes dans le modal (canal email/sms, type projet) */
.ei-modal-form .ei-toggle-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ei-modal-form .ei-toggle-btn {
    flex: 1 1 auto;
    padding: 7px 10px;
    font-size: .8rem;
    border-radius: 8px;
    min-width: 0;
}

/* Note RGPD compacte */
.ei-rgpd-notice {
    font-size: .72rem;
    color: #6b7280;
    line-height: 1.4;
    padding: 6px 0;
}
.ei-rgpd-notice label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
}
.ei-rgpd-notice input {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Bouton submit plus compact */
.ei-modal-form .ei-btn-primary {
    padding: 11px 20px;
    font-size: .95rem;
    font-weight: 700;
    margin-top: 4px;
}

/* Message d'erreur inline */
#ei-lead-error {
    font-size: .8rem;
    padding: 8px 10px;
    border-radius: 6px;
}

/* ===== Mobile ===== */
@media (max-width: 520px) {
    .ei-modal-overlay { padding: 10px 6px; }
    .ei-modal {
        padding: 20px 18px;
        border-radius: 12px;
        max-height: calc(100vh - 20px);
    }
    .ei-modal-title   { font-size: 1.1rem; }
    .ei-modal-subtitle{ font-size: .78rem; }
    .ei-modal-row     { grid-template-columns: 1fr; gap: 8px; }
    .ei-modal-benefits{ grid-template-columns: 1fr; }
    .ei-modal-preview-price { font-size: 1.2rem; }
}

/* Très petits écrans */
@media (max-height: 700px) {
    .ei-modal-icon { display: none; } /* gain d'espace vertical */
    .ei-modal-subtitle { margin-bottom: 10px; }
    .ei-modal-benefits { display: none; } /* on masque sur petits écrans pour prioriser le form */
}
