/* ──────────────────────────────────────────
   Prespa Newsletter – Popup Styles
────────────────────────────────────────── */

/* Overlay */
.pns-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: pnsFadeIn 0.3s ease;
}
.pns-overlay[hidden] { display: none !important; }

@keyframes pnsFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal */
.pns-modal {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: pnsSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 92vh;
    overflow-y: auto;
}

@keyframes pnsSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Close button */
.pns-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.pns-close:hover { background: #f0f0f0; color: #333; }

/* Icon */
.pns-modal-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 12px;
}
.pns-icon-success { color: #28a745; }

/* Headings */
.pns-modal h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: #1a1a2e;
    line-height: 1.3;
}

.pns-subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0 0 22px;
    line-height: 1.5;
}

/* Fields */
.pns-field {
    margin-bottom: 16px;
}
.pns-field label:not(.pns-cat-label) {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}
.pns-field input[type="text"],
.pns-field input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    background: #fafafa;
}
.pns-field input[type="text"]:focus,
.pns-field input[type="email"]:focus {
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
    background: #fff;
}

/* ── Select2 overrides — scoped inside the modal ── */

/* Container */
#pns-overlay .select2-container {
    width: 100% !important;
}
#pns-overlay .select2-container--default .select2-selection--multiple {
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    padding: 4px 6px;
    min-height: 42px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
#pns-overlay .select2-container--default.select2-container--focus .select2-selection--multiple,
#pns-overlay .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26,26,46,.08);
    background: #fff;
    outline: none;
}

/* Tags (selected items) */
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 4px 8px 4px 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 3px 4px 3px 0;
    display: inline-flex;
    align-items: center;
    flex-direction: row;
    gap: 6px;
    line-height: 1.4;
}

/* Remove button — hide the * text, show a proper × via ::after */
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0;          /* hide the * text */
    line-height: 0;
    color: transparent;
    position: relative;
    transition: background .15s;
}
/* Inject a proper × via pseudo-element */
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__choice__remove::after {
    content: '\00D7';     /* × unicode */
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255,255,255,.85);
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: rgba(255,255,255,.38);
}
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover::after {
    color: #fff;
}

/* Tag label text — ensure it comes before the × (order: 1) */
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    order: 1;
}

/* Placeholder */
#pns-overlay .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #aaa;
    font-size: 14px;
    padding: 2px 4px;
}

/* Input inside the selection box */
#pns-overlay .select2-container--default .select2-selection--multiple .select2-search__field {
    font-size: 13px;
    color: #333;
    margin-top: 2px;
}

/* Dropdown panel — must be above modal overlay */
.select2-container--open .select2-dropdown {
    border: 1.5px solid #1a1a2e;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    overflow: hidden;
    z-index: 1000000 !important;
}
.select2-container--open .select2-dropdown--below { border-top: none; border-radius: 0 0 8px 8px; }
.select2-container--open .select2-dropdown--above { border-bottom: none; border-radius: 8px 8px 0 0; }

/* Search box inside dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #1a1a2e;
}

/* Options */
.select2-container--default .select2-results__option {
    font-size: 13px;
    padding: 8px 12px;
    color: #333;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #1a1a2e;
    color: #fff;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background: #f0f4ff;
    color: #1a1a2e;
    font-weight: 600;
}
.select2-container--default .select2-results__option[aria-selected=true]::before {
    content: '✓  ';
    font-weight: 700;
    color: #1a1a2e;
}

/* Subscribe button */
.pns-btn-subscribe {
    display: block;
    width: 100%;
    padding: 13px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}
.pns-btn-subscribe:hover  { background: #16213e; }
.pns-btn-subscribe:active { transform: scale(0.99); }
.pns-btn-subscribe:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Close final button */
.pns-btn-close-final {
    display: block;
    margin: 20px auto 0;
    padding: 10px 28px;
    background: transparent;
    color: #1a1a2e;
    border: 2px solid #1a1a2e;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.pns-btn-close-final:hover {
    background: #1a1a2e;
    color: #fff;
}

/* Notices */
.pns-notice {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 14px;
}
.pns-notice[hidden] { display: none !important; }
.pns-notice-error {
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Privacy line */
.pns-privacy {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin: 10px 0 0;
}

/* ─ Responsive ─ */
@media (max-width: 480px) {
    .pns-modal { padding: 30px 20px 24px; }
    .pns-modal h2 { font-size: 18px; }
}
