/* DecoloresNatur Welcome Popup
   Layout vertical por defecto (móvil y tablet en vertical),
   horizontal a partir de 900px (escritorio y tablet apaisada). */

/* El tema no siempre normaliza box-sizing: sin esto el padding del input
   se suma al 100% de ancho y el campo sobresale del panel. */
.dcnwp,
.dcnwp *,
.dcnwp *::before,
.dcnwp *::after {
    box-sizing: border-box;
}

.dcnwp {
    --dcnwp-panel-bg: #FAF7F5;
    --dcnwp-title: #6E6E6E;
    --dcnwp-hl-bg: #FED588;
    --dcnwp-hl-color: #FFFFFF;
    --dcnwp-input-border: #2E2E63;
    --dcnwp-btn-bg: #0A0A0A;
    --dcnwp-btn-color: #FFFFFF;
    --dcnwp-footnote: #9A9A9A;
    --dcnwp-overlay: rgba(0, 0, 0, .55);
    --dcnwp-max-width: 760px;
    --dcnwp-radius: 4px;
    --dcnwp-img-position: center;

    /* La visibilidad la controla el JS con display en línea (igual que el
       popup del test de piel), no el atributo hidden: así ninguna hoja de
       estilos del tema puede dejarlo invisible por especificidad. */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .3s ease;
    font-family: inherit;
}

.dcnwp.dcnwp--visible {
    opacity: 1;
}

body.dcnwp-modal-open {
    overflow: hidden;
}

.dcnwp__overlay {
    position: absolute;
    inset: 0;
    background: var(--dcnwp-overlay);
    cursor: pointer;
}

.dcnwp__modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: hidden auto;
    background: var(--dcnwp-panel-bg);
    border-radius: var(--dcnwp-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    transform: translateY(16px) scale(.98);
    transition: transform .32s cubic-bezier(.2, .8, .3, 1);
    -webkit-overflow-scrolling: touch;
}

.dcnwp.dcnwp--visible .dcnwp__modal {
    transform: none;
}

/* --- Cerrar --- */
.dcnwp__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    color: #111;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    line-height: 0;
    transition: opacity .2s ease, transform .2s ease;
}

.dcnwp__close:hover {
    opacity: .65;
    transform: scale(1.08);
}

.dcnwp__close:focus-visible {
    outline: 2px solid var(--dcnwp-input-border);
    outline-offset: 2px;
}

.dcnwp__close svg {
    width: 19px;
    height: 19px;
    fill: none;
}

/* --- Imagen --- */
.dcnwp__media {
    position: relative;
    flex: 0 0 auto;
    aspect-ratio: 1.38 / 1;
    overflow: hidden;
    background: #EFE9E4;
}

.dcnwp__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center var(--dcnwp-img-position);
}

/* --- Panel de contenido --- */
.dcnwp__panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    padding: 26px 24px 30px;
    text-align: center;
}

.dcnwp__title {
    margin: 0 0 14px;
    color: var(--dcnwp-title);
    font-size: 24px;
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: .2px;
    text-transform: none;
}

.dcnwp__highlight {
    margin: 0 0 20px;
    padding: 9px 16px;
    color: var(--dcnwp-hl-color);
    background: var(--dcnwp-hl-bg);
    border-radius: var(--dcnwp-radius);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

/* --- Formulario --- */
.dcnwp__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}

.dcnwp__input {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 14px 22px;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid var(--dcnwp-input-border);
    border-radius: 999px;
    box-shadow: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: box-shadow .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.dcnwp__input::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

.dcnwp__input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 46, 99, .16);
}

.dcnwp__input.has-error {
    border-color: #c0392b;
}

.dcnwp__consent {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 4px;
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
}

.dcnwp__consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 0 5px 0 0;
    accent-color: #2563EB;
    cursor: pointer;
}

.dcnwp__consent label {
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

/* El enlace queda fuera del label y por encima, para que el clic navegue
   en lugar de marcar el checkbox. */
.dcnwp__consent a {
    position: relative;
    z-index: 2;
    color: inherit;
    text-decoration: underline;
    pointer-events: auto;
    cursor: pointer;
}

.dcnwp__button {
    width: 100%;
    margin: 4px 0 0;
    padding: 15px 20px;
    color: var(--dcnwp-btn-color);
    background: var(--dcnwp-btn-bg);
    border: 0;
    border-radius: var(--dcnwp-radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .4px;
    line-height: 1.2;
    cursor: pointer;
    transition: opacity .2s ease, transform .15s ease;
}

.dcnwp__button:hover {
    opacity: .88;
}

.dcnwp__button:active {
    transform: translateY(1px);
}

.dcnwp__button[disabled] {
    opacity: .6;
    cursor: default;
}

.dcnwp__error {
    margin: 0;
    color: #c0392b;
    font-size: 13px;
    line-height: 1.35;
}

.dcnwp__hp {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.dcnwp__footnote {
    margin: 18px 0 0;
    color: var(--dcnwp-footnote);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.55;
}

.dcnwp__footnote a {
    color: inherit;
    text-decoration: underline;
}

/* --- Estado de éxito --- */
.dcnwp__success {
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dcnwp__check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    color: var(--dcnwp-hl-color);
    background: var(--dcnwp-hl-bg);
    border-radius: 50%;
}

.dcnwp__check svg {
    width: 28px;
    height: 28px;
}

.dcnwp__success-text {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.dcnwp__success-text p {
    margin: 0 0 8px;
}

/* --- Escritorio y tablet apaisada: layout horizontal --- */
@media (min-width: 900px) {

    .dcnwp__modal {
        flex-direction: row;
        max-width: var(--dcnwp-max-width);
        min-height: 420px;
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
    }

    .dcnwp__close {
        top: 18px;
        right: 18px;
    }

    .dcnwp__close svg {
        width: 21px;
        height: 21px;
    }

    .dcnwp__media {
        flex: 0 0 42%;
        aspect-ratio: auto;
        height: auto;
    }

    .dcnwp__panel {
        flex: 1 1 58%;
        padding: 44px 42px;
    }

    .dcnwp__title {
        margin-bottom: 12px;
        font-size: 26px;
    }

    .dcnwp__highlight {
        margin-bottom: 22px;
        padding: 10px 18px;
        font-size: 30px;
    }

    .dcnwp__footnote {
        margin-top: 22px;
    }
}

/* Pantallas amplias: un poco más de aire */
@media (min-width: 1200px) {
    .dcnwp__panel {
        padding: 48px 48px;
    }
}

/* Respeta la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {

    .dcnwp,
    .dcnwp__modal,
    .dcnwp__close,
    .dcnwp__button {
        transition: none;
    }

    .dcnwp__modal {
        transform: none;
    }
}
