/**
 * Zdrowotka Newsletter — style popupu.
 * Izolowane pod .zw-np żeby nie konfliktowały z motywem zdrowotka-theme.
 */

.zw-np {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #222;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.zw-np.zw-np-open {
    display: flex;
    animation: zwNpFadeIn 0.3s ease-out;
}

.zw-np-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 74, 48, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.zw-np-box {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(28, 74, 48, 0.3);
    padding: 36px 32px 28px;
    overflow-y: auto;
    animation: zwNpSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.zw-np-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    padding: 0;
}
.zw-np-close:hover {
    background: #e8e8e8;
    color: #1c4a30;
    transform: rotate(90deg);
}

/* Badge */
.zw-np-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #f0faf0;
    color: #2d7a4a;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 100px;
    margin-bottom: 16px;
    border: 1px solid #d8ead8;
}

/* Tytuł */
.zw-np-title {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 32px;
    font-weight: 700;
    color: #1c4a30;
    margin: 0 0 10px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.zw-np-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0 0 22px;
    line-height: 1.55;
}

/* Baner z kodem — z efektem shimmer */
.zw-np-banner {
    position: relative;
    margin: 0 0 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #2d7a4a 0%, #1c4a30 100%);
    color: #ffffff;
    border-radius: 12px;
    font-size: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(45, 122, 74, 0.25);
}
.zw-np-banner strong {
    font-weight: 700;
    color: #ffffff;
}
.zw-np-banner-text {
    position: relative;
    z-index: 2;
    display: inline-block;
}
.zw-np-banner-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: zwNpShimmer 2.5s infinite;
    z-index: 1;
}

/* Pasek Wiktora */
.zw-np-wiktor {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fafaf8;
    border-radius: 10px;
    margin-bottom: 18px;
    border-left: 3px solid #2d7a4a;
}
.zw-np-wiktor-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1c4a30;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}
.zw-np-wiktor-text {
    font-size: 12px;
    color: #555;
    line-height: 1.45;
}
.zw-np-wiktor-text strong {
    color: #1c4a30;
    font-weight: 600;
}

/* Formularz */
.zw-np-form {
    margin: 0 0 18px;
}
.zw-np-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.zw-np-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.zw-np-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e4e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #222;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 10px;
    box-sizing: border-box;
    outline: none;
}
.zw-np-input:focus {
    border-color: #2d7a4a;
    box-shadow: 0 0 0 3px rgba(45, 122, 74, 0.12);
}
.zw-np-input::placeholder {
    color: #aaa;
}

.zw-np-submit {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2d7a4a 0%, #1c4a30 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(45, 122, 74, 0.3);
}
.zw-np-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 122, 74, 0.4);
}
.zw-np-submit:active:not(:disabled) {
    transform: translateY(0);
}
.zw-np-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.zw-np-submit-ghost {
    background: transparent;
    color: #2d7a4a;
    border: 2px solid #e0e4e0;
    box-shadow: none;
    margin-top: 8px;
}
.zw-np-submit-ghost:hover:not(:disabled) {
    background: #f5f5f5;
    transform: none;
    box-shadow: none;
}

.zw-np-error {
    min-height: 0;
    color: #c23;
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.45;
    display: none;
}
.zw-np-error.zw-np-error-show {
    display: block;
    animation: zwNpShake 0.4s;
}

/* Benefity 2x2 */
.zw-np-benefits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f0;
}
.zw-np-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    line-height: 1.3;
}
.zw-np-benefit-ico {
    font-size: 18px;
    flex-shrink: 0;
}

/* Stopka */
.zw-np-footer {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}
.zw-np-footer a {
    color: #888;
    text-decoration: underline;
}

/* State switcher */
.zw-np-state[hidden] { display: none; }

/* Success state */
.zw-np-success-icon {
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    animation: zwNpPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.zw-np-success-msg {
    font-size: 16px;
    color: #444;
    margin: 0 0 12px;
    line-height: 1.5;
}
.zw-np-success-hint {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px;
    line-height: 1.55;
}

/* Animacje */
@keyframes zwNpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes zwNpSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes zwNpShimmer {
    0%   { left: -100%; }
    100% { left: 200%; }
}
@keyframes zwNpShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}
@keyframes zwNpPop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile — dopasowanie do demografii 40+ z wymagań zdrowotka-theme */
@media (max-width: 520px) {
    .zw-np {
        padding: 10px;
        align-items: flex-end;
    }
    .zw-np-box {
        padding: 28px 22px 22px;
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }
    .zw-np.zw-np-open .zw-np-box {
        animation: zwNpSlideUpMobile 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .zw-np-title {
        font-size: 26px;
    }
    .zw-np-subtitle {
        font-size: 14px;
    }
    .zw-np-input,
    .zw-np-submit {
        font-size: 16px; /* iOS nie zoomuje przy >=16px */
        padding: 14px 16px;
    }
    .zw-np-benefits {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .zw-np-benefit {
        font-size: 13px;
    }
}

@keyframes zwNpSlideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Zablokuj scroll body gdy popup otwarty */
body.zw-np-lock {
    overflow: hidden;
}

/* =============== EDGE-TO-EDGE MODE =============== */
/* Custom HTML wypełnia całe okno — zero paddingu na boxie */
.zw-np-box.zw-np-edge {
    padding: 0 !important;
    overflow: hidden;
}
/* Przycisk X przesuwamy na górę z półprzezroczystym tłem żeby był czytelny
   na dowolnym kolorze headera */
.zw-np-box.zw-np-edge .zw-np-close {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    top: 12px;
    right: 12px;
    z-index: 10;
}
.zw-np-box.zw-np-edge .zw-np-close:hover {
    background: #ffffff;
}
