/**
 * BCS Alert Widget — Styles
 * Chargé conditionnellement uniquement sur les pages contenant le shortcode
 * [bcs_alerte_immobiliere] / [bcs_alerte_immobiliere_btn] ou le widget BCS Alert.
 *
 * @package BCS\Alerts
 * @since   2.2.0 — v2 popup + fix texte blanc
 */

/* ═══════════════════════════════════════════════════════════════════════════
   BOUTON DÉCLENCHEUR POPUP
   ═══════════════════════════════════════════════════════════════════════════ */

.bcs-alert-btn-wrap {
    display: inline-block;
    text-align: center;
}

.bcs-alert-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #2c5f8a;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1.4;
}

.bcs-alert-open-btn:hover,
.bcs-alert-open-btn:focus {
    background-color: #1e3a5f;
    color: #ffffff !important;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Variante footer (fond sombre) */
.widget_bcs_alert_widget .bcs-alert-open-btn,
#footer-sidebar-3 .bcs-alert-open-btn {
    background-color: #e8a039;
}

.widget_bcs_alert_widget .bcs-alert-open-btn:hover,
#footer-sidebar-3 .bcs-alert-open-btn:hover {
    background-color: #cf8a2a;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OVERLAY POPUP
   ═══════════════════════════════════════════════════════════════════════════ */

.bcs-alert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.bcs-alert-overlay.bcs-alert-open {
    display: flex;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALE
   ═══════════════════════════════════════════════════════════════════════════ */

.bcs-alert-modal {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px 28px;
    box-sizing: border-box;
    font-family: inherit;
}

/* Bouton fermeture */
.bcs-alert-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.bcs-alert-modal-close:hover {
    color: #111827;
    background: #f3f4f6;
}

/* Titre de la modale */
.bcs-alert-modal-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a5f;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TEXTE D'INTRODUCTION — FIX couleur texte
   ═══════════════════════════════════════════════════════════════════════════ */

.bcs-alert-intro,
.bcs-alert-modal .bcs-alert-intro,
.bcs-alert-widget .bcs-alert-intro,
.bcs-alert-modal p.bcs-alert-intro-text {
    display: block;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.65;
    /* Correction : forcer la couleur sombre — le footer sombre héritait #fff sur #fff */
    color: #374151 !important;
    background: transparent !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENEUR WIDGET (mode inline, hors popup)
   ═══════════════════════════════════════════════════════════════════════════ */

.bcs-alert-widget {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMULAIRE WPFORMS (dans modale ET inline)
   ═══════════════════════════════════════════════════════════════════════════ */

.bcs-alert-modal .wpforms-container,
.bcs-alert-widget .wpforms-container {
    margin-top: 0;
}

.bcs-alert-modal .wpforms-field,
.bcs-alert-widget .wpforms-field {
    margin-bottom: 16px;
}

.bcs-alert-modal .wpforms-field-label,
.bcs-alert-widget .wpforms-field-label {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 4px;
}

/* Sous-labels (prénom / nom) */
.bcs-alert-modal .wpforms-field-sublabel,
.bcs-alert-widget .wpforms-field-sublabel {
    font-size: 12px;
    color: #6b7280;
}

.bcs-alert-modal .wpforms-field input[type="text"],
.bcs-alert-modal .wpforms-field input[type="email"],
.bcs-alert-modal .wpforms-field input[type="tel"],
.bcs-alert-modal .wpforms-field input[type="number"],
.bcs-alert-modal .wpforms-field select,
.bcs-alert-modal .wpforms-field textarea,
.bcs-alert-widget .wpforms-field input[type="text"],
.bcs-alert-widget .wpforms-field input[type="email"],
.bcs-alert-widget .wpforms-field input[type="tel"],
.bcs-alert-widget .wpforms-field input[type="number"],
.bcs-alert-widget .wpforms-field select,
.bcs-alert-widget .wpforms-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background-color: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.bcs-alert-modal .wpforms-field input:focus,
.bcs-alert-modal .wpforms-field select:focus,
.bcs-alert-modal .wpforms-field textarea:focus,
.bcs-alert-widget .wpforms-field input:focus,
.bcs-alert-widget .wpforms-field select:focus,
.bcs-alert-widget .wpforms-field textarea:focus {
    outline: none;
    border-color: #2c5f8a;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.10);
}

/* Choices.js (select moderne field_9 type de bien) */
.bcs-alert-modal .choices,
.bcs-alert-widget .choices {
    margin-bottom: 0;
}

.bcs-alert-modal .choices__inner,
.bcs-alert-widget .choices__inner {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #f9fafb;
    min-height: 42px;
    padding: 6px 14px;
    font-size: 14px;
    color: #111827;
}

.bcs-alert-modal .choices.is-focused .choices__inner,
.bcs-alert-widget .choices.is-focused .choices__inner {
    border-color: #2c5f8a;
    box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.10);
}

/* International Phone Input (iti) */
.bcs-alert-modal .iti,
.bcs-alert-widget .iti {
    width: 100%;
}

.bcs-alert-modal .iti__tel-input,
.bcs-alert-widget .iti__tel-input {
    width: 100%;
    box-sizing: border-box;
}

/* Bouton soumission */
.bcs-alert-modal .wpforms-submit-container button,
.bcs-alert-modal .wpforms-submit,
.bcs-alert-widget .wpforms-submit-container button,
.bcs-alert-widget .wpforms-submit {
    width: 100%;
    padding: 12px 24px;
    background-color: #2c5f8a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 8px;
}

.bcs-alert-modal .wpforms-submit-container button:hover,
.bcs-alert-modal .wpforms-submit:hover,
.bcs-alert-widget .wpforms-submit-container button:hover,
.bcs-alert-widget .wpforms-submit:hover {
    background-color: #1e3a5f;
}

/* Messages confirmation/erreur */
.bcs-alert-modal .wpforms-confirmation-container,
.bcs-alert-modal .wpforms-confirmation-container-full,
.bcs-alert-widget .wpforms-confirmation-container,
.bcs-alert-widget .wpforms-confirmation-container-full {
    padding: 16px;
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    color: #166534;
    font-size: 15px;
}

.bcs-alert-modal .wpforms-error,
.bcs-alert-widget .wpforms-error {
    color: #b91c1c;
    font-size: 13px;
    margin-top: 4px;
}

/* Indicateur champ requis */
.bcs-alert-modal .wpforms-required-label,
.bcs-alert-widget .wpforms-required-label {
    color: #b91c1c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER WIDGET — texte du bouton visible sur fond sombre
   ═══════════════════════════════════════════════════════════════════════════ */

/* Le widget dans le footer affiche seulement un bouton, pas le formulaire inline */
.widget_bcs_alert_widget .bcs-alert-btn-wrap {
    display: block;
    text-align: center;
    padding: 8px 0;
}

/* Titre du widget dans le footer */
.widget_bcs_alert_widget .widget-title,
#footer-sidebar-3 .widget-title {
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .bcs-alert-modal {
        padding: 24px 16px 20px;
        max-height: 95vh;
    }

    .bcs-alert-modal-title {
        font-size: 17px;
        padding-right: 32px;
    }

    .bcs-alert-modal .wpforms-field input[type="text"],
    .bcs-alert-modal .wpforms-field input[type="email"],
    .bcs-alert-modal .wpforms-field input[type="tel"],
    .bcs-alert-modal .wpforms-field input[type="number"],
    .bcs-alert-modal .wpforms-field select {
        font-size: 16px; /* Empêche le zoom iOS */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS INLINE — comportement popup via data-attributes (voir shortcode)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Trap focus visuel quand overlay ouvert */
body.bcs-alert-modal-active {
    overflow: hidden;
}
