.emw-footer,
.emw-popup {
    --emw-radius: 2px;
    --emw-serif: Iowan Old Style, Baskerville, Times New Roman, serif;
    --emw-sans: gothambook, "Helvetica Neue", Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    font-family: var(--emw-sans);
}

.emw-footer *,
.emw-popup * {
    box-sizing: border-box;
}

.emw-footer .screen-reader-text,
.emw-popup .screen-reader-text,
.emw-signup--compact .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.emw-footer {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: clamp(48px, 7vw, 90px) 24px;
    background: var(--emw-ink);
    color: #fff;
}

.emw-footer::before {
    position: absolute;
    top: 0;
    right: 10%;
    width: 260px;
    height: 1px;
    background: color-mix(in srgb, var(--emw-accent) 75%, white);
    content: "";
}

.emw-footer__inner {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.emw-signup__form-state[hidden],
.emw-success[hidden] {
    display: none !important;
}

.emw-signup--footer > .emw-signup__form-state {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
    gap: clamp(48px, 8vw, 120px);
    align-items: center;
}

.emw-signup__eyebrow {
    margin: 0 0 14px;
    color: var(--emw-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1.4;
    text-transform: uppercase;
}

.emw-signup__title {
    max-width: 640px;
    margin: 0;
    color: inherit;
    font-family: var(--emw-serif);
    font-size: clamp(34px, 4.5vw, 60px);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 0.98;
}

.emw-signup--footer .emw-signup__title {
    color: #fff;
}

.emw-signup__text {
    max-width: 620px;
    margin: 20px 0 0;
    color: inherit;
    font-size: 15px;
    line-height: 1.65;
    opacity: 0.78;
}

.emw-form__line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    border-bottom: 1px solid currentColor;
}

.emw-form__email {
    min-width: 0;
    height: 54px;
    padding: 0 16px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font: inherit;
    font-size: 16px;
}

.emw-form__email::placeholder {
    color: currentColor;
    opacity: 0.55;
}

.emw-form__email:focus {
    outline: 0;
}

.emw-form__line:focus-within {
    border-color: var(--emw-accent);
    box-shadow: 0 1px 0 var(--emw-accent);
}

.emw-form__submit {
    display: inline-flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0 0 5px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--emw-radius);
    background: var(--emw-accent);
    color: var(--emw-button-ink);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: filter 180ms ease, transform 180ms ease;
}

.emw-form__submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.emw-form__submit:focus-visible,
.emw-popup__close:focus-visible,
.emw-success__coupon button:focus-visible {
    outline: 2px solid var(--emw-accent);
    outline-offset: 3px;
}

.emw-form__submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

.emw-form__submit svg {
    width: 18px;
    height: 18px;
    transition: transform 180ms ease;
}

.emw-form__submit:hover svg {
    transform: translateX(3px);
}

.emw-form__submit.is-loading svg {
    animation: emw-pulse 850ms ease-in-out infinite alternate;
}

.emw-form__consent {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-top: 16px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1.5;
    opacity: 0.72;
}

.emw-form__consent input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.emw-form__check {
    position: relative;
    display: block;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    border: 1px solid currentColor;
}

.emw-form__consent input:checked + .emw-form__check {
    border-color: var(--emw-accent);
    background: var(--emw-accent);
}

.emw-form__consent input:checked + .emw-form__check::after {
    position: absolute;
    top: 2px;
    left: 4px;
    width: 4px;
    height: 7px;
    border: solid var(--emw-button-ink);
    border-width: 0 1.5px 1.5px 0;
    content: "";
    transform: rotate(45deg);
}

.emw-form__consent input:focus-visible + .emw-form__check {
    outline: 2px solid var(--emw-accent);
    outline-offset: 3px;
}

.emw-form__consent a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.emw-form__honeypot,
.emw-form__target {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.emw-success {
    max-width: 620px;
    animation: emw-rise 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.emw-success__mark {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 22px;
    border: 1px solid var(--emw-accent);
    border-radius: 50%;
    color: var(--emw-accent);
    place-items: center;
}

.emw-success__mark svg {
    width: 22px;
    height: 22px;
}

.emw-success__label {
    margin: 26px 0 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    opacity: 0.66;
    text-transform: uppercase;
}

.emw-success__coupon {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}

.emw-success__coupon code {
    padding: 12px 18px;
    background: transparent;
    color: inherit;
    font-family: var(--emw-sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.emw-success__coupon button {
    padding: 0 15px;
    border: 0;
    border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

body.emw-popup-open {
    overflow: hidden;
}

.emw-popup[hidden] {
    display: none !important;
}

.emw-popup {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    padding: 24px;
    color: var(--emw-ink);
    place-items: center;
}

.emw-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 15, 0.68);
    opacity: 0;
    backdrop-filter: blur(6px);
    transition: opacity 260ms ease;
}

.emw-popup__dialog {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 0.86fr) minmax(390px, 1.14fr);
    width: min(940px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow: hidden;
    border-radius: 4px;
    outline: 0;
    background: var(--emw-surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 280ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.emw-popup.is-visible .emw-popup__backdrop,
.emw-popup.is-visible .emw-popup__dialog {
    opacity: 1;
}

.emw-popup.is-visible .emw-popup__dialog {
    transform: translateY(0) scale(1);
}

.emw-popup__close {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--emw-surface) 90%, transparent);
    color: var(--emw-ink);
    cursor: pointer;
}

.emw-popup__close::before,
.emw-popup__close::after {
    position: absolute;
    top: 20px;
    left: 13px;
    width: 16px;
    height: 1px;
    background: currentColor;
    content: "";
}

.emw-popup__close::before {
    transform: rotate(45deg);
}

.emw-popup__close::after {
    transform: rotate(-45deg);
}

.emw-popup__media {
    position: relative;
    min-height: 550px;
    overflow: hidden;
    background: var(--emw-accent);
}

.emw-popup__image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    inset: 0;
}

.emw-popup__media::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(7, 16, 11, 0.24));
    content: "";
    pointer-events: none;
}

.emw-popup__media--empty {
    display: grid;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.22), transparent 30%),
        linear-gradient(145deg, color-mix(in srgb, var(--emw-accent) 76%, #fff), var(--emw-accent));
    place-items: center;
}

.emw-popup__media--empty::before {
    position: absolute;
    width: 72%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    content: "";
}

.emw-popup__monogram {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--emw-serif);
    font-size: 120px;
    font-style: italic;
}

.emw-popup__content {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow-y: auto;
    padding: clamp(44px, 6vw, 76px);
}

.emw-signup--popup {
    width: 100%;
}

.emw-signup--popup .emw-signup__title {
    font-size: clamp(36px, 4vw, 54px);
}

.emw-signup--popup .emw-form {
    margin-top: 30px;
}

.emw-signup--popup .emw-form__line {
    grid-template-columns: 1fr;
    gap: 14px;
    border: 0;
    box-shadow: none;
}

.emw-signup--popup .emw-form__email {
    width: 100%;
    padding: 0 16px !important;
    border: 1px solid color-mix(in srgb, var(--emw-ink) 26%, transparent) !important;
    background: rgba(255, 255, 255, 0.45) !important;
}

.emw-signup--popup .emw-form__email:focus {
    border-color: var(--emw-accent) !important;
    box-shadow: 0 0 0 1px var(--emw-accent) !important;
}

.emw-signup--popup .emw-form__submit {
    width: 100%;
    min-height: 52px;
    margin: 0;
}

.emw-signup--popup .emw-form__consent {
    color: var(--emw-ink);
}

.emw-signup--popup .emw-success .emw-signup__title {
    font-size: clamp(34px, 4vw, 48px);
}

.emw-configuration-message {
    padding: 12px 16px;
    border-left: 3px solid #dba617;
    background: #fff8df;
    color: #3c434a;
}

@keyframes emw-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes emw-pulse {
    from { transform: translateX(0); }
    to { transform: translateX(5px); }
}

@media (max-width: 760px) {
    .emw-signup--footer > .emw-signup__form-state {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .emw-popup {
        align-items: end;
        padding: 12px;
    }

    .emw-popup__dialog {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 24px);
    }

    .emw-popup__media {
        min-height: 180px;
        max-height: 28vh;
    }

    .emw-popup__monogram {
        font-size: 72px;
    }

    .emw-popup__content {
        padding: 36px 28px 32px;
    }

    .emw-signup--popup .emw-signup__title {
        font-size: clamp(34px, 10vw, 44px);
    }
}

@media (max-width: 520px) {
    .emw-footer {
        padding-right: 20px;
        padding-left: 20px;
    }

    .emw-form__line {
        grid-template-columns: 1fr;
        gap: 12px;
        border: 0;
    }

    .emw-signup--footer .emw-form__email {
        padding: 0 !important;
        border-bottom: 1px solid currentColor !important;
    }

    .emw-signup--footer .emw-form__submit {
        width: 100%;
        min-height: 50px;
        margin: 0;
    }

    .emw-popup__media {
        min-height: 120px;
    }

    .emw-popup__content {
        padding: 30px 22px 26px;
    }

    .emw-popup__close {
        top: 10px;
        right: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .emw-popup__backdrop,
    .emw-popup__dialog,
    .emw-form__submit,
    .emw-form__submit svg,
    .emw-success {
        animation: none !important;
        transition: none !important;
    }
}

/* Version 1.2 : présentation minimale adaptée aux thèmes éditoriaux. */
.emw-footer {
    padding: clamp(42px, 6vw, 72px) 24px;
    border-top: 1px solid var(--emw-ink);
    background: var(--emw-surface);
    color: var(--emw-ink);
}

.emw-footer::before {
    display: none;
}

.emw-footer .emw-signup--footer > .emw-signup__form-state {
    grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
    gap: clamp(40px, 7vw, 96px);
}

.emw-footer .emw-signup__eyebrow,
.emw-popup .emw-signup__eyebrow {
    color: inherit;
    font-size: 10px;
    letter-spacing: 0.22em;
    opacity: 0.62;
}

.emw-footer .emw-signup__title {
    color: var(--emw-ink);
    font-family: var(--emw-sans);
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.08;
    text-transform: uppercase;
}

.emw-footer .emw-signup__text,
.emw-popup .emw-signup__text {
    font-size: 13px;
    line-height: 1.65;
}

.emw-footer .emw-form__line {
    border-color: var(--emw-ink);
}

.emw-footer .emw-form__email {
    color: var(--emw-ink) !important;
}

.emw-footer .emw-form__submit,
.emw-popup .emw-form__submit {
    border-radius: 0;
    background: var(--emw-ink);
    color: var(--emw-button-ink);
}

.emw-signup--compact {
    width: 100%;
    max-width: 100%;
    color: inherit;
    font-family: inherit;
}

.emw-signup--compact > .emw-signup__form-state {
    display: block;
}

.emw-signup--compact .emw-signup__compact-title {
    margin: 0 0 28px;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.2;
    text-transform: uppercase;
}

.emw-signup--compact .emw-signup__text {
    margin: 0 0 16px;
    color: inherit;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.55;
    opacity: 0.72;
}

.emw-signup--compact .emw-form,
.emw-signup--compact .emw-form__line,
.emw-signup--compact .emw-form__email {
    width: 100%;
    max-width: 100%;
}

.emw-signup--compact .emw-form__line {
    display: block;
    border-bottom: 0;
}

.emw-signup--compact .emw-form__email {
    display: block;
    height: 40px;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid currentColor !important;
    background: transparent !important;
    color: currentColor !important;
    font-family: inherit;
    font-size: 12px;
}

body .emw-signup--compact input.emw-form__email {
    border-bottom: 1px solid var(--emw-ink, #111111) !important;
    color: var(--emw-ink, #111111) !important;
    font-family: gothambook, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    -webkit-text-fill-color: var(--emw-ink, #111111);
}

body .emw-signup--compact input.emw-form__email::placeholder {
    color: var(--emw-ink, #111111) !important;
    opacity: 0.58 !important;
}

.emw-signup--compact .emw-form__submit {
    display: inline-flex;
    width: auto;
    min-height: 34px;
    margin: 9px 0 0;
    padding: 0;
    background: transparent;
    color: currentColor;
    font-size: 10px;
    letter-spacing: 0.16em;
}

body .emw-signup--compact button.emw-form__submit {
    color: var(--emw-ink, #111111) !important;
    font-family: gotham, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-size: 10px;
    font-weight: 500;
}

.emw-signup--compact .emw-form__submit:hover {
    background: transparent;
    filter: none;
}

.emw-signup--compact .emw-form__consent {
    margin-top: 12px;
    color: inherit;
    font-size: 10px;
}

.emw-signup--compact .emw-success__mark {
    width: 34px;
    height: 34px;
    margin-bottom: 16px;
}

.emw-signup--compact .emw-signup__title {
    color: inherit;
    font-family: inherit;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.emw-signup--compact .emw-success__coupon {
    max-width: 100%;
}

.emw-popup__backdrop {
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: none;
}

.emw-popup__dialog {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(480px, 100%);
    max-height: calc(100vh - 48px);
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 0;
    background: var(--emw-surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.emw-popup__dialog--with-image {
    grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
    width: min(760px, 100%);
}

.emw-popup__dialog--with-image .emw-popup__media {
    min-height: 440px;
    max-height: none;
    height: 100%;
}

.emw-popup__dialog--with-image .emw-popup__content {
    display: flex;
    align-items: center;
}

.emw-popup__media {
    min-height: 170px;
    max-height: 190px;
    background: #f2f2f2;
}

.emw-popup__media--empty {
    display: none;
}

.emw-popup__media::after {
    display: none;
}

.emw-popup__content {
    display: block;
    padding: 36px 38px 34px;
}

.emw-popup__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.92);
}

.emw-popup__close::before,
.emw-popup__close::after {
    top: 17px;
    left: 11px;
    width: 14px;
}

.emw-signup--popup .emw-signup__title {
    color: var(--emw-ink);
    font-family: var(--emw-sans);
    font-size: clamp(24px, 2.2vw, 30px);
    font-weight: 400;
    letter-spacing: 0.015em;
    line-height: 1.14;
}

.emw-signup--popup .emw-form {
    margin-top: 22px;
}

.emw-signup--popup .emw-form__line {
    gap: 16px;
}

.emw-signup--popup .emw-form__email {
    height: 48px;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--emw-ink) !important;
    background: transparent !important;
    color: var(--emw-ink) !important;
    font-size: 13px;
}

.emw-signup--popup .emw-form__email:focus {
    border-color: var(--emw-ink) !important;
    box-shadow: none !important;
}

.emw-signup--popup .emw-form__submit {
    min-height: 46px;
    font-size: 10px;
    letter-spacing: 0.16em;
}

.emw-signup--popup .emw-form__consent {
    margin-top: 14px;
    font-size: 10px;
}

.emw-popup .emw-success__mark {
    border-color: var(--emw-ink);
    color: var(--emw-ink);
}

.emw-signup--popup .emw-success .emw-signup__title {
    font-size: clamp(27px, 3vw, 34px);
}

@media (max-width: 760px) {
    .emw-popup {
        align-items: center;
        padding: 16px;
    }

    .emw-popup__dialog {
        max-height: calc(100vh - 32px);
    }

    .emw-popup__dialog--with-image {
        grid-template-columns: minmax(0, 1fr);
        width: min(520px, 100%);
    }

    .emw-popup__dialog--with-image .emw-popup__media {
        height: 145px;
        min-height: 145px;
        max-height: 145px;
    }

    .emw-popup__media {
        min-height: 125px;
        max-height: 145px;
    }

    .emw-popup__content {
        padding: 36px 26px 30px;
    }

    .emw-signup--popup .emw-signup__title {
        font-size: 24px;
    }
}

@media (max-width: 520px) {
    .emw-popup__dialog--with-image .emw-popup__media {
        height: 120px;
        min-height: 120px;
        max-height: 120px;
    }

    .emw-popup__media {
        min-height: 100px;
        max-height: 120px;
    }

    .emw-popup__content {
        padding: 32px 22px 26px;
    }

    .emw-popup__close {
        top: 8px;
        right: 8px;
    }
}
