/* ==========================================================================
   GESIB.RO - Newsletter (formular din footer, bife de acord, popup cu cupon)
   Folosește variabilele temei din app.css (inclusiv modul întunecat).
   ========================================================================== */

.nl-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* câmp-capcană anti-bot: în afara ecranului, nu display:none (unii boți îl ignoră) */
.nl-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Bifa de acord (formulare de cont, checkout, footer, popup) ---------- */
.nl-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary, var(--text-muted));
    cursor: pointer;
    text-align: left;
}
.nl-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--brand-red);
    cursor: pointer;
}

/* ---------- Formular în footer ---------- */
.nl-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: center;
    margin: 0 0 28px;
    padding: 22px 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
}
.nl-footer h3 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 800;
}
.nl-footer p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}
.nl-fields {
    display: flex;
    gap: 10px;
}
.nl-form input[type="email"],
.nl-form input[type="text"].nl-name {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 15px;
}
.nl-form input[type="email"]:focus,
.nl-form input.nl-name:focus {
    outline: 2px solid var(--brand-red);
    outline-offset: 1px;
}
.nl-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-red);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}
.nl-btn:hover {
    background: var(--brand-red-hover);
}
.nl-btn[disabled] {
    opacity: 0.65;
    cursor: wait;
}
.nl-msg {
    min-height: 18px;
    margin: 8px 0 0 !important;
    font-size: 13px !important;
    font-weight: 600;
}
.nl-msg.is-ok {
    color: #1B7F3B !important;
}
.nl-msg.is-err {
    color: var(--brand-red-text) !important;
}

/* ---------- Popup ---------- */
.nl-pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
}
.nl-pop-backdrop.is-open {
    display: flex;
}
.nl-pop {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 26px 22px;
    border-radius: 14px;
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.nl-pop h2 {
    margin: 0 28px 8px 0;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 800;
}
.nl-pop p {
    margin: 0 0 12px;
    font-size: 14.5px;
    color: var(--text-muted);
}
.nl-pop-badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-red-soft);
    color: var(--brand-red-text);
    font-size: 13.5px;
    font-weight: 800;
}
.nl-pop-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.nl-pop-close:hover {
    background: var(--brand-red-soft);
    color: var(--text-primary);
}
.nl-pop .nl-fields {
    flex-direction: column;
}
.nl-pop .nl-btn {
    width: 100%;
}
.nl-pop-later {
    display: block;
    margin: 10px auto 0;
    padding: 6px 10px;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .nl-footer {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        padding: 18px 16px;
    }
    .nl-fields {
        flex-direction: column;
    }
    .nl-btn {
        width: 100%;
        min-height: 48px;
    }
    .nl-form input[type="email"] {
        font-size: 16px; /* fără zoom automat în iOS */
        min-height: 48px;
    }
    .nl-consent {
        font-size: 13.5px;
    }
    .nl-consent input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    /* popup = „bottom sheet”, deasupra barei de navigare jos (64px), deci nu o acoperă */
    .nl-pop-backdrop {
        top: 0;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        align-items: flex-end;
        justify-content: center;
        padding: 0;
        z-index: 950;
    }
    .nl-pop {
        max-width: none;
        max-height: 82vh;
        border-radius: 16px 16px 0 0;
        padding: 22px 18px 18px;
        animation: nlSheetUp 0.22s ease-out;
    }
    body.has-buybar .nl-pop-backdrop {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }
}
@keyframes nlSheetUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .nl-pop {
        animation: none !important;
    }
}
