/* ==========================================================================
   Nielco Newsletter — Popup
   ========================================================================== */

/* Overlay — dækker hele skærmen */
.nn-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: nn-fade-in .25s ease;
    box-sizing: border-box;
}

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

/* Forhindrer scroll på body mens popup er åben */
body.nn-popup-open {
    overflow: hidden;
}

/* Popup-boks */
.nn-popup-box {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    width: 100%;
    max-width: 480px;
    max-height: 90dvh;
    overflow-y: auto;
    animation: nn-slide-up .3s ease;
    box-sizing: border-box;
}

/* Indhold */
.nn-popup-content {
    padding: 40px 36px 32px;
}

/* Luk-knap */
.nn-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    z-index: 1;
}
.nn-popup-close:hover {
    color: #111827;
    background: #f3f4f6;
}
.nn-popup-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Overskrift */
.nn-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* Brødtekst */
.nn-popup-text {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 20px;
    line-height: 1.55;
}

/* Formular-felter — genanvender nn-field fra form.css */
.nn-popup-form .nn-field {
    margin-bottom: 14px;
}
.nn-popup-form .nn-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.nn-popup-form .nn-field input[type="text"],
.nn-popup-form .nn-field input[type="email"] {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.nn-popup-form .nn-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* GDPR */
.nn-popup-form .nn-gdpr {
    margin-bottom: 16px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}
.nn-popup-form .nn-gdpr label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    cursor: pointer;
}
.nn-popup-form .nn-gdpr input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* Statusbesked */
.nn-popup-msg {
    font-size: 13px;
    min-height: 16px;
    margin-bottom: 10px;
}

/* Tilmeld-knap */
.nn-popup-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: #1d4ed8;
    color: #ffffff;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
    -webkit-appearance: none;
}
.nn-popup-btn:hover    { background: #1e40af; }
.nn-popup-btn:active   { transform: scale(.98); }
.nn-popup-btn:disabled { background: #93c5fd; cursor: not-allowed; }
.nn-popup-btn:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

/* Succesbesked */
.nn-popup-success {
    text-align: center;
    padding: 16px 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #065f46;
}
.nn-popup-success::before {
    content: '✓ ';
    font-size: 20px;
}

/* Animationer */
@keyframes nn-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes nn-slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Mobil
   ========================================================================== */
@media (max-width: 540px) {
    .nn-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .nn-popup-box {
        max-width: 100%;
        border-radius: 14px 14px 0 0;
        max-height: 92dvh;
        animation: nn-slide-up-mobile .3s ease;
    }
    .nn-popup-content {
        padding: 28px 20px 24px;
    }
    .nn-popup-title {
        font-size: 20px;
        padding-right: 32px; /* plads til luk-knap */
    }
    @keyframes nn-slide-up-mobile {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* Respekter prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .nn-popup-overlay,
    .nn-popup-box {
        animation: none;
    }
}
