/* =========================================================
   SeniorMutuelle.fr — Popup, modals, bouton flottant, cookie
   ========================================================= */

/* -------- IMPORTANT : l'attribut HTML `hidden` doit toujours
   primer sur les `display:` du CSS (sinon les popups/modals
   restent visibles + ne se ferment pas). -------- */
[hidden] { display: none !important; }

/* -------- Popup lead magnet -------- */
.popup-magnet {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: var(--sp-4);
    animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.popup-backdrop {
    position: absolute; inset: 0;
    background: rgba(20, 63, 102, .7);
    backdrop-filter: blur(4px);
}
.popup-content {
    position: relative; z-index: 1;
    background: #fff; border-radius: 16px;
    max-width: 720px; width: 100%;
    box-shadow: 0 16px 48px rgba(0,0,0,.3);
    overflow: hidden;
    animation: popupIn .35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh; overflow-y: auto;
}
@keyframes popupIn {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.popup-close {
    position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,.9); border: 0;
    border-radius: 50%; font-size: 28px;
    cursor: pointer; z-index: 2;
    line-height: 1; color: var(--c-text);
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.popup-close:hover { background: var(--c-border); }

.popup-grid {
    display: grid; grid-template-columns: 280px 1fr;
}
@media (max-width: 640px) {
    .popup-grid { grid-template-columns: 1fr; }
}

.popup-visual {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    color: #fff; padding: var(--sp-8);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative;
}
@media (max-width: 640px) { .popup-visual { padding: var(--sp-6); min-height: 200px; } }

.popup-badge {
    position: absolute; top: 16px; left: 16px;
    background: var(--c-secondary); color: #fff;
    padding: 6px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .5px;
}

.popup-book {
    width: 140px; height: 180px;
    position: relative;
    transform: rotate(-4deg);
    transition: transform .3s;
}
.popup-magnet:hover .popup-book { transform: rotate(0); }

.popup-book-cover {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    color: var(--c-primary);
    width: 100%; height: 100%;
    border-radius: 4px 12px 12px 4px;
    box-shadow: -4px 4px 16px rgba(0,0,0,.25);
    padding: 24px 16px;
    display: flex; flex-direction: column; justify-content: space-between;
    text-align: center;
    border-left: 6px solid var(--c-secondary);
}
.popup-book-title {
    font-size: 18px; font-weight: 700; line-height: 1.2;
}
.popup-book-subtitle {
    font-size: 14px; color: var(--c-text-muted);
}

.popup-body { padding: var(--sp-8); }
@media (max-width: 640px) { .popup-body { padding: var(--sp-6); } }

.popup-eyebrow {
    color: var(--c-secondary); font-weight: 600; font-size: 14px;
    text-transform: uppercase; letter-spacing: .5px;
    margin: 0 0 8px;
}
.popup-body h2 {
    margin: 0 0 var(--sp-4); color: var(--c-primary);
    font-size: 26px; line-height: 1.2; text-align: left;
}
.popup-lead { font-size: var(--fs-base); color: var(--c-text); }

.popup-benefits {
    list-style: none; padding: 0; margin: var(--sp-4) 0;
    font-size: var(--fs-sm);
}
.popup-benefits li { padding: 4px 0; }

.form-inline-magnet .form-group { margin-bottom: 12px; }
.form-inline-magnet input { font-size: var(--fs-base); padding: 12px 14px; min-height: 50px; }
.form-inline-magnet .form-check label { font-size: 13px; }

.popup-microcopy {
    text-align: center; font-size: 13px;
    color: var(--c-text-muted); margin-top: 12px;
}

.popup-success {
    text-align: center; padding: var(--sp-8);
}

/* -------- Bouton flottant -------- */
.floating-cta {
    position: fixed; bottom: 24px; right: 24px; z-index: 95;
}
@media (max-width: 768px) {
    .floating-cta { bottom: 80px; right: 16px; } /* éviter mobile bottom bar */
}

.fc-toggle {
    display: flex; align-items: center; gap: 10px;
    background: var(--c-secondary); color: #fff;
    border: 0; padding: 14px 20px;
    border-radius: 32px;
    font-size: 16px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(39, 174, 96, .35);
    cursor: pointer;
    transition: all .2s;
}
.fc-toggle:hover { background: var(--c-secondary-dark); transform: translateY(-2px); }
.fc-toggle-icon { font-size: 22px; }
@media (max-width: 768px) {
    .fc-toggle-label { display: none; }
    .fc-toggle { padding: 14px; border-radius: 50%; width: 56px; height: 56px; justify-content: center; }
}

.fc-panel {
    position: absolute; bottom: calc(100% + 12px); right: 0;
    background: #fff; border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.2);
    padding: var(--sp-6);
    width: 340px;
    animation: popupIn .25s ease;
}
@media (max-width: 400px) {
    .fc-panel { width: calc(100vw - 32px); right: -16px; }
}

.fc-close {
    position: absolute; top: 8px; right: 8px;
    background: transparent; border: 0;
    width: 32px; height: 32px;
    font-size: 24px; cursor: pointer;
    color: var(--c-text-muted);
}

.fc-panel h3 {
    margin: 0 0 4px; font-size: 18px; color: var(--c-primary);
}
.fc-subtitle {
    margin: 0 0 var(--sp-4); font-size: 14px; color: var(--c-text-muted);
}

.fc-action {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 14px;
    border: 2px solid var(--c-border);
    border-radius: 12px;
    background: #fff; color: var(--c-text);
    text-decoration: none;
    margin-bottom: 10px;
    cursor: pointer;
    text-align: left;
    transition: all .2s;
}
.fc-action:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
    text-decoration: none;
    color: var(--c-text);
}
.fc-action-primary { border-color: var(--c-secondary); background: var(--c-secondary-soft); }
.fc-action-primary:hover { border-color: var(--c-secondary-dark); background: var(--c-secondary-soft); }
.fc-action-icon { font-size: 28px; }
.fc-action-text { flex: 1; }
.fc-action-text strong {
    display: block; font-size: 15px; font-weight: 600;
}
.fc-action-text small {
    color: var(--c-text-muted); font-size: 13px;
}
.fc-action-arrow {
    color: var(--c-primary); font-weight: 700;
}

.fc-reassurance {
    text-align: center; margin-top: var(--sp-4);
    padding-top: var(--sp-4); border-top: 1px solid var(--c-border);
    font-size: 13px; color: var(--c-text-muted);
}

/* -------- Modal rappel -------- */
.modal {
    position: fixed; inset: 0; z-index: 1100;
    display: flex; align-items: center; justify-content: center;
    padding: var(--sp-4);
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(20, 63, 102, .7);
}
.modal-content {
    position: relative; background: #fff;
    border-radius: 16px;
    max-width: 500px; width: 100%;
    padding: var(--sp-8);
    box-shadow: 0 16px 48px rgba(0,0,0,.3);
    max-height: 90vh; overflow-y: auto;
    animation: popupIn .25s ease;
}
.modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px;
    background: transparent; border: 0;
    font-size: 28px; cursor: pointer;
}
.modal h2 {
    text-align: left; color: var(--c-primary);
    margin: 0 0 8px; font-size: 24px;
}

/* -------- Cookie banner -------- */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: #fff;
    border-top: 4px solid var(--c-primary);
    box-shadow: 0 -8px 24px rgba(0,0,0,.1);
    padding: var(--sp-4);
}
.cookie-banner-inner {
    max-width: var(--container-max); margin: 0 auto;
    display: flex; align-items: center; gap: var(--sp-6);
    flex-wrap: wrap;
}
.cookie-text { flex: 1; min-width: 280px; }
.cookie-text strong { display: block; margin-bottom: 4px; }
.cookie-text p { margin: 0; font-size: 14px; color: var(--c-text-muted); }
.cookie-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
}
@media (max-width: 768px) {
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { flex: 1; min-width: 0; padding: 12px 8px; font-size: 14px; }
}
