/* ================================================================
   SmartRiver Popup Newsletter — Frontend popup styles
   ================================================================ */

/* ── Modal shell ── */
.modal-backdrop.srpn-backdrop,
.modal-backdrop.in,
.modal-backdrop.show {
    background: rgba(10, 10, 20, 0.55);
    backdrop-filter: blur(3px);
}

.srpn-dialog {
    width: calc(100vw - 32px);
    max-width: 900px;
    margin: 1.5rem auto;
}

/* Entry animation on modal-content (Bootstrap ne touche pas ce niveau) */
.srpn-modal {
    transform: scale(0.94) translateY(14px);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.22s ease;
}

.smartriverpopupnewsletter-modal.show .srpn-modal,
.smartriverpopupnewsletter-modal.in .srpn-modal,
.smartriverpopupnewsletter-modal.srpn-open .srpn-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Modal card ── */
.modal-content.srpn-modal {
    display: flex;
    flex-direction: row;
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.1);
    min-height: 480px;
    background: #fff;
}

.srpn-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Left panel: image ── */
.srpn-panel--image {
    flex: 0 0 42%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.srpn-panel--image__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(0, 0, 0, 0.08) 0%,
        rgba(0, 0, 0, 0.35) 100%
    );
}

/* ── Right panel: content ── */
.srpn-panel--content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #ffffff;
    overflow-y: auto;
}

.srpn-panel--content-full {
    flex: 1 1 100%;
}

/* ── Close button ── */
.srpn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.srpn-close:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
}

/* ── Body ── */
.srpn-body {
    flex: 1;
    padding: 44px 36px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Title & text ── */
.srpn-title {
    color: #0f172a;
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.srpn-title h2, .srpn-title h4 { margin: 0; font-size: inherit; font-weight: inherit; }

.srpn-text {
    color: #4b5563;
    font-size: clamp(14px, 1.3vw, 16px);
    line-height: 1.65;
    margin: 0;
}

.srpn-text p { margin-bottom: 0.5em; }
.srpn-text p:last-child { margin-bottom: 0; }

/* ── Countdown ── */
.srpn-countdown {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    width: fit-content;
}

.srpn-countdown.srpn-countdown--ready {
    display: inline-flex;
}

/* ── Email input ── */
.srpn-email {
    width: 100%;
    min-height: 50px;
    padding: 13px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    color: #111827;
    font-size: 15px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
}

.srpn-email::placeholder { color: #9ca3af; }

.srpn-email:focus {
    border-color: #111827;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.07);
}

/* ── GDPR ── */
.srpn-gdpr {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.srpn-gdpr__input { display: none; }

.srpn-gdpr__box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.srpn-gdpr__input:checked ~ .srpn-gdpr__box {
    background: #111827;
    border-color: #111827;
}

.srpn-gdpr__input:checked ~ .srpn-gdpr__box::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
}

.srpn-gdpr__text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.srpn-gdpr__text a {
    color: #111827;
    text-decoration: underline;
}

/* ── Submit button ── */
.srpn-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 13px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
    text-decoration: none;
}

.srpn-btn--primary {
    background: #111827;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.22);
}

.srpn-btn--primary:hover,
.srpn-btn--primary:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.28);
    filter: brightness(1.08);
    color: #ffffff;
    outline: none;
}

.srpn-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.18);
}

.srpn-btn.gdpr_disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.srpn-btn--loading {
    pointer-events: none;
    color: transparent !important;
    opacity: 0.82;
}

.srpn-btn--loading::before,
.srpn-btn--loading::after {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.srpn-btn--loading::before {
    content: '';
    width: 18px;
    height: 18px;
    margin-left: -42px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: srpn-button-spin 0.75s linear infinite;
}

.srpn-btn--loading::after {
    content: 'Envoi...';
    color: #ffffff;
    font-weight: 700;
}

/* Member mode: amber button */
.srpn-modal--member .srpn-btn--primary {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    color: #111827;
    box-shadow: 0 4px 16px rgba(180, 83, 9, 0.22);
}

/* ── Register link ── */
.srpn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 2px;
    border-top: 1px solid #f3f4f6;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
}

.srpn-register:hover {
    color: #111827;
    text-decoration: none;
}

/* ── Feedback messages ── */
.smartriver-popup-response {
    min-height: 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.smartriver-popup-response.srpn-response--visible {
    opacity: 1;
    transform: translateY(0);
}

.srpn-msg,
.srpn-feedback,
.smartriver-popup-response p {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.srpn-feedback {
    animation: srpn-message-in 0.34s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.srpn-feedback__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-top: -1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.srpn-feedback__icon::before {
    content: '';
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.srpn-feedback__content {
    flex: 1 1 auto;
    min-width: 0;
}

.srpn-feedback__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    animation: srpn-progress var(--srpn-delay, 3000ms) linear forwards;
}

.srpn-msg--success,
.smartriver-popup-response .alert-success,
.srpn-feedback--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.smartriver-popup-response .alert-danger,
.srpn-msg--error,
.srpn-feedback--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.smartriver-popup-response .alert-info,
.srpn-feedback--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.smartriver-popup-response .alert-warning,
.srpn-feedback--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.srpn-feedback--loading {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.srpn-feedback--loading .srpn-feedback__icon {
    border: 2px solid #cbd5e1;
    border-top-color: #111827;
    animation: srpn-spin 0.75s linear infinite;
}

.srpn-feedback--loading .srpn-feedback__icon::before {
    display: none;
}

.srpn-feedback--success .srpn-feedback__icon { background: #dcfce7; }
.srpn-feedback--error .srpn-feedback__icon { background: #fee2e2; }
.srpn-feedback--info .srpn-feedback__icon { background: #dbeafe; }
.srpn-feedback--warning .srpn-feedback__icon { background: #fef3c7; }

.srpn-feedback--success .srpn-feedback__progress { background: #22c55e; }
.srpn-feedback--error .srpn-feedback__progress { background: #ef4444; }
.srpn-feedback--info .srpn-feedback__progress { background: #3b82f6; }
.srpn-feedback--warning .srpn-feedback__progress { background: #f59e0b; }

@keyframes srpn-message-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes srpn-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@keyframes srpn-spin {
    to { transform: rotate(360deg); }
}

@keyframes srpn-button-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Footer: ne plus afficher + plus tard ── */
.srpn-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 36px 20px;
    border-top: 1px solid #f3f4f6;
}

/* "Ne plus afficher" */
.srpn-no-show {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    user-select: none;
}

.srpn-no-show input[type="checkbox"] { display: none; }

.srpn-no-show__box {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.srpn-no-show input:checked ~ .srpn-no-show__box {
    background: #6b7280;
    border-color: #6b7280;
}

.srpn-no-show input:checked ~ .srpn-no-show__box::after {
    content: '';
    display: block;
    width: 8px;
    height: 5px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
}

/* "Plus tard" */
.srpn-later {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.srpn-later:hover { color: #374151; }

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 900px) {
    #moda_popupnewsletter {
        align-items: center;
        justify-content: center;
        padding: 12px;
    }

    #moda_popupnewsletter.in,
    #moda_popupnewsletter.show,
    #moda_popupnewsletter.srpn-open {
        display: flex !important;
    }

    .srpn-dialog {
        width: 100%;
        max-width: 460px;
        margin: 0 auto;
    }

    .modal-content.srpn-modal {
        flex-direction: column;
        border-radius: 16px;
        min-height: auto;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .srpn-panel--image {
        flex: 0 0 auto;
        width: 100%;
        height: 190px;
        background-position: center 32%;
    }

    .srpn-panel--content {
        overflow: visible;
    }

    .srpn-body {
        padding: 30px 24px 16px;
        gap: 14px;
    }

    .srpn-footer {
        padding: 12px 24px 18px;
    }

    .srpn-title {
        font-size: clamp(20px, 7vw, 28px);
    }
}

@media (max-width: 640px) {
    .srpn-dialog {
        max-width: 420px;
    }

    .srpn-panel--image {
        height: 180px;
    }
}

@media (max-width: 400px) {
    .srpn-body { padding: 24px 18px 12px; }
    .srpn-footer { padding: 12px 18px 16px; }
}
