/* ============================================================================
   REJOICE — Newsletter Popup V2
   Artisan styl, rohový slide-in vpravo dole, prefix: .rej2-
   ============================================================================ */

/* Overlay — rohová pozice, bez tmavého pozadí */
.rej2-popup-overlay {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    pointer-events: none;
}

.rej2-popup-overlay.is-visible {
    pointer-events: auto;
}

/* Karta */
.rej2-popup {
    position: relative;
    width: 310px;
    background-color: #f5eedf;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    border-radius: 12px;
    border: 1px solid #d4bfa0;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: visible;
    transform: translateY(40px) scale(0.85);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.2),
                opacity 0.3s ease-out;
}

.rej2-popup-overlay.is-visible .rej2-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Vnitřní steh — dashed border */
.rej2-popup::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1.5px dashed rgba(150, 110, 60, 0.25);
    border-radius: 7px;
    pointer-events: none;
    z-index: 0;
}

/* Obsah nad pseudo-elementem */
.rej2-popup__body,
.rej2-popup__success,
.rej2-popup__badge-wrap {
    position: relative;
    z-index: 1;
}

/* Zavírací tlačítko */
.rej2-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(150, 110, 60, 0.3);
    background: rgba(245, 238, 223, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.rej2-popup__close:hover {
    background: rgba(251, 188, 4, 0.25);
}

.rej2-popup__close svg {
    width: 12px;
    height: 12px;
    color: #6b5040;
}

/* ── Badge ── */
.rej2-popup__badge-wrap {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 4px;
}

.rej2-popup__badge {
    position: relative;
    display: inline-block;
    background: #FBBC04;
    color: #1a1200;
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
    padding: 3px 18px 5px;
    border-radius: 5px;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.16);
}

/* ── Tělo ── */
.rej2-popup__body {
    padding: 6px 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Knoflík — dekorativní prvek v rohu odznaku */
.rej2-knoflik {
    position: absolute;
    bottom: -9px;
    right: -9px;
    transform: rotate(10deg);
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
    pointer-events: none;
}

/* Ochrana + skip — těsně u sebe */
.rej2-popup__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    margin-top: 6px;
}

/* ── Nadpis ── */
.rej2-popup__title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #1e1208;
    text-align: center;
    margin: 4px 0 5px;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

/* Dekorační čára */
.rej2-popup__divider {
    width: 36px;
    height: 2px;
    background: #FBBC04;
    border-radius: 2px;
    margin: 0 auto 8px;
}

/* Popis */
.rej2-popup__text {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #5a4030;
    text-align: center;
    line-height: 1.5;
    margin: 0 0 10px;
}

/* Formulář */
.rej2-popup__form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
}

/* Input */
.rej2-popup__input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #c8b090;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-style: italic;
    color: #2a1a08;
    background: rgba(255, 252, 245, 0.9);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rej2-popup__input::placeholder {
    color: #b0906a;
}

.rej2-popup__input:focus {
    font-style: normal;
    border-color: #8b6030;
    box-shadow: 0 0 0 3px rgba(139, 96, 48, 0.1);
}

/* CTA — sjednoceno s globálním .btn na rejoice.cz (Opal) */
.rej2-popup__btn {
    width: 100% !important;
    min-height: 55px;
    padding: 0 45px !important;
    border: none !important;
    border-radius: 10px !important;
    background: #000000 !important;
    color: #fff !important;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    animation: rej2-pulse 2s ease-in-out 3s 3;
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
}

.rej2-popup__btn:hover {
    background: #FBBC04 !important;
}

.rej2-popup__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@keyframes rej2-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.3); }
    50%       { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
}

/* Podmínka */
.rej2-popup__condition {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    color: #9a7a5a;
    font-style: italic;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    padding: 3px 8px;
    background: rgba(210, 190, 160, 0.2);
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

/* Privacy */
.rej2-popup__privacy {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    color: #8a6a4a;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4;
    transition: color 0.2s;
}

.rej2-popup__privacy:hover {
    color: #1e1208;
}

/* Skip */
.rej2-popup__skip {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    color: #9a7a5a !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    cursor: pointer !important;
    transition: color 0.2s;
}

.rej2-popup__skip:hover {
    color: #5a3a1a !important;
    background: none !important;
}

/* Error */
.rej2-popup__error {
    display: none;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #c02020;
    text-align: left;
    width: 100%;
    margin: 0;
}

.rej2-popup__error.is-visible {
    display: block;
}

/* Spinner */
.rej2-popup__btn .rej2-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(251, 188, 4, 0.3);
    border-top-color: #FBBC04;
    border-radius: 50%;
    animation: rej2-spin 0.6s linear infinite;
    margin: 0 auto;
}

.rej2-popup__btn.is-loading .rej2-spinner { display: block; }
.rej2-popup__btn.is-loading .rej2-btn-label { display: none; }

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

/* Hidden/Success */
.rej2-popup__body.is-hidden { display: none; }

.rej2-popup__success {
    display: none;
    padding: 24px 20px 28px;
    text-align: center;
}

.rej2-popup__success.is-active { display: block; }

.rej2-popup__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FBBC04;
    margin-bottom: 12px;
}

.rej2-popup__success-icon svg {
    width: 20px;
    height: 20px;
    color: #1e1208;
}

.rej2-popup__success h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #1e1208;
    margin: 0 0 6px;
}

.rej2-popup__success p {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #5a4030;
    margin: 0;
    line-height: 1.5;
}

/* ── Mobile — bottom sheet ── */
@media (max-width: 520px) {
    .rej2-popup-overlay {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .rej2-popup {
        width: 100%;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(100%);
        opacity: 0;
    }

    .rej2-popup-overlay.is-visible .rej2-popup {
        transform: translateY(0);
        opacity: 1;
    }

    .rej2-popup__body {
        padding: 6px 16px 14px;
    }

    .rej2-popup__badge {
        font-size: 22px;
    }

    .rej2-popup__title {
        font-size: 15px;
    }
}
