/* =========================================
   EFENA PREMIUM THEME - NEWSLETTER POPUP
   Based on Black/White/Metallic aesthetic
   Couleurs et dimensions : variables --enp-* (Réglages → Apparence)
   ========================================= */

/* Polices EFENA (fichiers locaux, chargés seulement si utilisés) */
@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/cormorant-garamond.woff2') format('woff2');
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/cormorant-garamond-italic.woff2') format('woff2');
}

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/jost.woff2') format('woff2');
}

/* Container & Overlay */
.efena-np {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
    font-family: var(--enp-font, 'Arial', sans-serif);
    color: var(--enp-text, #000000);
}

.efena-np *,
.efena-np *::before,
.efena-np *::after {
    box-sizing: border-box;
}

.efena-np [hidden] {
    display: none !important;
}

.efena-np.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0s;
}

.efena-np-overlay {
    position: absolute;
    inset: 0;
    background: var(--enp-overlay, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

body.efena-np-locked {
    overflow: hidden;
}

/* Dialog */
.efena-np-dialog {
    position: relative;
    width: 100%;
    max-width: var(--enp-width, 520px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--enp-bg, #ffffff);
    border-radius: var(--enp-radius, 0);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    outline: none;
}

.efena-np.is-open .efena-np-dialog {
    transform: translateY(0);
}

/* Close Button */
.efena-np .efena-np-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--enp-accent, #000000);
    border: 1px solid var(--enp-accent, #000000);
    border-radius: var(--enp-radius, 0);
    color: var(--enp-accent-text, #ffffff);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
}

.efena-np .efena-np-close:hover,
.efena-np .efena-np-close:focus-visible {
    background: var(--enp-accent-text, #ffffff);
    color: var(--enp-accent, #000000);
}

.efena-np-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

/* Media */
.efena-np-media {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #000000;
}

.efena-np-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--enp-img-pos, center);
    transform: scale(1.04);
    transition: transform 6s ease;
}

.efena-np.is-open .efena-np-media img {
    transform: scale(1);
}

/* Fallback sans image : dégradé métallique */
.efena-np-media--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 90% at 20% 10%, #3a3f45 0%, transparent 55%),
        linear-gradient(135deg, #0b0b0b 0%, #1c1f22 45%, #708090 100%);
}

.efena-np-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffffff;
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 12px;
    line-height: 1;
    padding-left: 12px;
    margin-bottom: 30px;
}

.efena-np-wordmark small {
    margin-top: 12px;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 8px;
    color: #c9d1d9;
}

/* Badge offre (verre dépoli) */
.efena-np-badge {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    padding: 14px 22px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--enp-radius, 0);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    text-align: left;
}

.efena-np-badge-title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
}

.efena-np-badge-text {
    margin-top: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #e5e7eb;
}

/* Body */
.efena-np-body {
    padding: 34px 36px 30px;
    text-align: center;
}

.efena-np-kicker {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    background: var(--enp-accent, #000000);
    color: var(--enp-accent-text, #ffffff);
    border-radius: var(--enp-radius, 0);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.efena-np .efena-np-title {
    margin: 0 0 12px;
    padding: 0;
    font-family: var(--enp-font, 'Arial', sans-serif);
    font-size: clamp(1.35rem, 3.2vw, 1.75rem);
    font-weight: 700;
    color: var(--enp-text, #000000);
    text-transform: var(--enp-transform, uppercase);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.efena-np .efena-np-subtitle {
    margin: 0 auto 26px;
    max-width: 400px;
    font-size: 0.95rem;
    font-weight: 400;
    font-style: italic;
    color: var(--enp-muted, #708090);
    line-height: 1.5;
}

/* Form */
.efena-np-form {
    margin: 0;
    text-align: left;
}

.efena-np .efena-np-input {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 12px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: var(--enp-radius, 0);
    background: #ffffff;
    font-family: var(--enp-font, 'Arial', sans-serif);
    font-size: 1rem;
    color: #000000;
    box-shadow: none;
    transition: all 0.3s ease;
}

.efena-np .efena-np-input::placeholder {
    color: #9aa5b1;
}

.efena-np .efena-np-input:focus {
    border-color: var(--enp-accent, #000000);
    outline: none;
    background: #fafafa;
}

.efena-np .efena-np-input.has-error {
    border-color: #b91c1c;
}

.efena-np-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Premium Button */
.efena-np .efena-np-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 18px 30px;
    background: var(--enp-accent, #000000);
    color: var(--enp-accent-text, #ffffff);
    border: 2px solid var(--enp-accent, #000000);
    border-radius: var(--enp-radius, 0);
    font-family: var(--enp-font, 'Arial', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.3s ease;
}

.efena-np .efena-np-submit:hover {
    background: var(--enp-accent-text, #ffffff);
    color: var(--enp-accent, #000000);
}

.efena-np .efena-np-submit:focus-visible {
    outline: 2px solid var(--enp-muted, #708090);
    outline-offset: 3px;
}

.efena-np-arrow {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    transition: transform 0.3s ease;
}

.efena-np-submit:hover .efena-np-arrow {
    transform: translateX(4px);
}

/* Loader */
.efena-np-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: efena-np-rotation 1s linear infinite;
}

.efena-np-form.is-loading .efena-np-submit {
    opacity: 0.8;
    cursor: wait;
}

.efena-np-form.is-loading .efena-np-loader {
    display: inline-block;
}

.efena-np-form.is-loading .efena-np-arrow {
    display: none;
}

@keyframes efena-np-rotation {
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.efena-np-message {
    margin: 12px 0 0;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    color: #b91c1c;
}

.efena-np-message:empty {
    display: none;
}

.efena-np-consent {
    margin: 16px 0 0;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #9aa5b1;
    text-align: center;
}

.efena-np-consent--check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.efena-np-consent--check input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--enp-accent, #000000);
}

/* Success step */
.efena-np-step--success {
    animation: efena-np-fadeInUp 0.6s ease-out;
}

.efena-np-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-bottom: 18px;
    border: 2px solid var(--enp-accent, #000000);
    border-radius: 50%;
    background: var(--enp-accent, #000000);
    color: var(--enp-accent-text, #ffffff);
}

.efena-np-check svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.efena-np-code {
    display: flex;
    align-items: stretch;
    margin: 0 0 14px;
    border: 1px dashed var(--enp-text, #000000);
    border-radius: var(--enp-radius, 0);
    overflow: hidden;
}

.efena-np-code-value {
    flex: 1;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--enp-text, #000000);
    text-align: center;
    user-select: all;
}

.efena-np .efena-np-copy {
    margin: 0;
    padding: 0 20px;
    background: transparent;
    color: var(--enp-text, #000000);
    border: 0;
    border-left: 1px dashed var(--enp-text, #000000);
    border-radius: 0;
    font-family: var(--enp-font, 'Arial', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.efena-np .efena-np-copy:hover {
    background: var(--enp-accent, #000000);
    color: var(--enp-accent-text, #ffffff);
}

@keyframes efena-np-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.efena-np .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Mise en page : image à gauche */
@media (min-width: 768px) {
    .efena-np--left .efena-np-dialog {
        display: grid;
        grid-template-columns: 45% 1fr;
        max-width: max(var(--enp-width, 520px), 760px);
    }

    .efena-np--left .efena-np-media {
        aspect-ratio: auto;
        min-height: 100%;
    }

    .efena-np--left .efena-np-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 56px 40px 40px;
    }
}

/* Mise en page : immersive (photo en plein fond, modèle 2) */
.efena-np--immersive .efena-np-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: max(var(--enp-width, 520px), 900px);
    min-height: 560px;
    background: #0b0b0b;
    color: #ffffff;
}

.efena-np--immersive .efena-np-media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
}

.efena-np--immersive .efena-np-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.15) 75%);
}

.efena-np--immersive .efena-np-body {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 640px;
    padding: 64px 40px;
    text-align: center;
}

.efena-np--immersive .efena-np-close {
    background: transparent;
    border-color: transparent;
    color: #ffffff;
}

.efena-np--immersive .efena-np-close:hover,
.efena-np--immersive .efena-np-close:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    color: #0b0b0b;
}

.efena-np--immersive .efena-np-title {
    margin: 0 0 14px;
    font-family: var(--enp-font);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

.efena-np--immersive .efena-np-offer {
    margin: 0;
    font-family: var(--enp-serif);
    font-size: clamp(5rem, 11vw, 8.5rem);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: -2px;
    color: #ffffff;
}

.efena-np--immersive .efena-np-offer-text {
    margin: 10px 0 30px;
    font-family: var(--enp-serif);
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    font-style: italic;
    color: #ffffff;
}

.efena-np--immersive .efena-np-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.efena-np--immersive .efena-np-form {
    max-width: 520px;
    margin: 0 auto;
}

.efena-np--immersive .efena-np-field {
    display: flex;
    background: #ffffff;
}

.efena-np--immersive .efena-np-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border: 0;
    font-family: var(--enp-font);
    font-size: 0.95rem;
}

.efena-np--immersive .efena-np-input:focus {
    background: #ffffff;
}

.efena-np--immersive .efena-np-submit {
    width: auto;
    flex: 0 0 auto;
    padding: 0 26px;
    background: #ffffff;
    color: #0b0b0b;
    border: 0;
    border-left: 1px solid #e4e4e4;
    font-family: var(--enp-font);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 3px;
}

.efena-np--immersive .efena-np-submit:hover {
    background: #0b0b0b;
    color: #ffffff;
}

.efena-np--immersive .efena-np-arrow {
    display: none;
}

.efena-np--immersive .efena-np-message {
    color: #fca5a5;
}

.efena-np--immersive .efena-np-consent {
    color: rgba(255, 255, 255, 0.7);
}

/* Étape 2 sur la photo */
.efena-np--immersive .efena-np-step--success .efena-np-title {
    font-family: var(--enp-serif);
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: 0;
    text-transform: none;
    color: #ffffff;
}

.efena-np--immersive .efena-np-check {
    background: transparent;
    border-color: #ffffff;
    color: #ffffff;
}

.efena-np--immersive .efena-np-step--success .efena-np-subtitle {
    font-style: normal;
}

.efena-np--immersive .efena-np-code {
    max-width: 440px;
    margin: 0 auto 16px;
    border-color: #ffffff;
    background: rgba(0, 0, 0, 0.35);
}

.efena-np--immersive .efena-np-code-value {
    color: #ffffff;
}

.efena-np--immersive .efena-np-copy {
    color: #ffffff;
    border-left-color: #ffffff;
}

.efena-np--immersive .efena-np-copy:hover {
    background: #ffffff;
    color: #0b0b0b;
}

.efena-np--immersive .efena-np-continue {
    max-width: 440px;
    margin: 0 auto;
    padding: 16px 24px;
    border: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
}

/* Mise en page : sans image */
.efena-np--none .efena-np-body {
    padding-top: 56px;
}

/* Responsive */
@media (max-width: 600px) {
    .efena-np {
        align-items: flex-end;
        padding: 0;
    }

    .efena-np-dialog {
        max-width: 100%;
        max-height: 92vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateY(100%);
    }

    .efena-np-media {
        aspect-ratio: 16 / 8;
    }

    .efena-np-badge {
        left: 16px;
        bottom: 16px;
        padding: 10px 16px;
    }

    .efena-np-badge-title {
        font-size: 1.5rem;
    }

    .efena-np-body {
        padding: 26px 20px 24px;
    }

    .efena-np .efena-np-subtitle {
        margin-bottom: 20px;
        font-size: 0.9rem;
    }
}

/* Immersive sur téléphone : carte plein écran, champ et bouton empilés */
@media (max-width: 600px) {
    .efena-np--immersive {
        align-items: center;
        padding: 12px;
    }

    .efena-np--immersive .efena-np-dialog {
        min-height: min(640px, calc(100vh - 24px));
        transform: translateY(20px);
    }

    .efena-np--immersive .efena-np-body {
        padding: 56px 22px 32px;
    }

    .efena-np--immersive .efena-np-field {
        flex-direction: column;
        gap: 10px;
        background: transparent;
    }

    .efena-np--immersive .efena-np-input {
        padding: 15px;
    }

    .efena-np--immersive .efena-np-submit {
        width: 100%;
        padding: 16px;
        border-left: 0;
    }
}

/* Protection contre les styles de champs du thème (ex. Goya "bordure du bas" :
   fond transparent, marges retirées en !important). Le fond, la bordure et la marge
   intérieure sont portés par .efena-np-input-wrap ; le champ lui-même reste neutre. */
#efena-np .efena-np-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin: 0 0 12px;
    padding: 0 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: var(--enp-radius, 0);
    transition: border-color 0.3s ease;
}

#efena-np .efena-np-input-wrap:focus-within {
    border-color: var(--enp-accent, #000000);
}

#efena-np .efena-np-input-wrap.has-error {
    border-color: #b91c1c;
}

#efena-np .efena-np-input {
    flex: 1;
    width: 100% !important;
    min-width: 0;
    height: auto !important;
    min-height: 48px;
    margin: 0 !important;
    padding-top: 13px !important;
    padding-bottom: 13px !important;
    background: transparent !important;
    color: #141414 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
    -webkit-text-fill-color: #141414;
    opacity: 1;
}

#efena-np .efena-np-input::placeholder {
    color: #8c8c8c !important;
    -webkit-text-fill-color: #8c8c8c;
    opacity: 1;
}

#efena-np.efena-np--immersive .efena-np-input-wrap {
    margin: 0;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .efena-np,
    .efena-np-dialog,
    .efena-np-media img {
        transition: none;
    }
}
