/* ==========================================================================
   NEUROPOST CORE STYLES (v10.10 - Anti-Jump & Bulletproof Headers)
   ========================================================================== */
.neuropost-wrapper { 
    margin: 0 auto 30px auto !important; /* Sztywny brak marginesu z góry */
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    color: #333; 
    position: relative; 
    box-sizing: border-box; 
    display: flex !important; /* Blokada zjawiska "Margin Collapse" powodującego skakanie kart */
    flex-direction: column !important;
}
.neuropost-wrapper * { 
    box-sizing: border-box; 
}

/* ==========================================================================
   TYPOGRAFIA I NAGŁÓWKI (OCHRONA PRZED MOTYWEM)
   ========================================================================== */
.neuropost-wrapper h2 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding-top: 0 !important;
    line-height: 1.2 !important;
}

/* Pancerne nagłówki z ikonami (ochrona przed Flatsome line-height) */
.neuropost-wrapper .np-card h3 {
    display: flex !important;
    align-items: center !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.neuropost-wrapper .np-card h3 .dashicons {
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
    line-height: 1 !important;
    margin-right: 10px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==========================================================================
   KARTY I PRZYCISKI
   ========================================================================== */
/* Zmiana: border-radius wyzerowany zgodnie z nowymi parametrami UI */
.np-card { 
    background: #ffffff !important; 
    border: 1px solid #e0e0e0 !important; 
    padding: 25px !important; 
    margin-bottom: 25px !important; 
    border-radius: 0px !important; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important; 
}

/* PRZYCISKI - border-radius na 0 */
.np-btn { 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    height: 40px !important; 
    padding: 0 20px !important; 
    font-size: 14px !important; 
    font-weight: 600 !important; 
    line-height: 1 !important; 
    text-decoration: none !important; 
    border-radius: 4px !important; 
    cursor: pointer !important; 
    border: 1px solid transparent !important; 
    transition: all 0.2s ease-in-out !important; 
    white-space: nowrap !important; 
    outline: none !important; 
    margin: 0 !important; 
}
.np-btn .dashicons { 
    font-size: 18px !important; 
    width: 18px !important; 
    height: 18px !important; 
    margin-right: 8px !important; 
    line-height: 1 !important; 
}

.np-btn-primary { background: #3366cc !important; border-color: #3366cc !important; color: #fff !important; }
.np-btn-primary:hover { background: #135e96 !important; border-color: #135e96 !important; color: #fff !important; }

.np-btn-secondary { background: #f0f0f1 !important; border-color: #c3c4c7 !important; color: #2c3338 !important; }
.np-btn-secondary:hover { background: #fff !important; border-color: #888 !important; }

.np-btn-danger { background: #d63638 !important; border-color: #d63638 !important; color: #fff !important; }
.np-btn-danger:hover { background: #a52224 !important; border-color: #a52224 !important; color: #fff !important; }

.np-btn-success { background: #00a32a !important; border-color: #00a32a !important; color: #fff !important; }
.np-btn-success:hover { background: #008a20 !important; border-color: #008a20 !important; color: #fff !important; }

.np-btn-sm { height: 30px !important; padding: 0 12px !important; font-size: 12px !important; }
.np-btn-block { display: flex !important; width: 100% !important; }

/* NAWIGACJA */
.np-header-nav { 
    display: flex !important; 
    flex-wrap: wrap !important; 
    gap: 10px !important; 
    justify-content: flex-end !important; 
    margin: 0 0 20px 0 !important; /* Sztywny margines */
}
.np-actions { 
    display: flex !important; 
    gap: 10px !important; 
    justify-content: flex-end !important; 
    margin-top: 20px !important; 
    padding-top: 20px !important; 
    border-top: 1px solid #eee !important; 
}

/* MEDIA (EDYCJA) */
#neuropost-form .np-media-preview { 
    display: flex !important; 
    flex-wrap: wrap !important; 
    gap: 10px !important; 
    margin-top: 15px !important; 
}

/* Galeria (Kafelki) - border-radius na 0 */
#neuropost-form .np-media-preview:not(.np-sortable-files) .np-preview-item {
    position: relative; 
    width: 90px; 
    height: 90px; 
    border: 1px solid #ddd; 
    background: #f9f9f9; 
    border-radius: 0px; 
    overflow: hidden; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: move;
}
#neuropost-form .np-media-preview:not(.np-sortable-files) img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* Załączniki (Lista Pionowa) - border-radius na 0 */
#neuropost-form .np-sortable-files { 
    flex-direction: column !important; 
    gap: 8px !important; 
}
#neuropost-form .np-sortable-files .np-preview-item {
    position: relative; 
    width: 100% !important; 
    height: auto !important; 
    display: flex; 
    align-items: center; 
    padding: 12px !important; 
    padding-right: 40px !important;
    background: #fff; 
    border: 1px solid #e0e0e0; 
    border-radius: 0px; 
    cursor: move;
}
#neuropost-form .np-sortable-files img { 
    width: 28px !important; 
    height: 28px !important; 
    margin-right: 15px !important; 
    object-fit: contain; 
}
#neuropost-form .np-sortable-files span { 
    font-weight: 500; 
    color: #333; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

/* FIX IKONY USUWANIA (X) */
.np-remove-item {
    position: absolute; 
    background: #d63638; 
    color: #fff; 
    width: 20px; 
    height: 20px; 
    line-height: 20px;
    text-align: center; 
    border-radius: 50%; 
    font-size: 14px; 
    cursor: pointer; 
    z-index: 10; 
    opacity: 0.8; 
    right: 2px; 
    top: 2px;
}
.np-sortable-files .np-remove-item { 
    top: 50%; 
    transform: translateY(-50%); 
    right: 10px; 
}
.np-remove-item:hover { 
    opacity: 1; 
}

/* INNE */
.np-auth-wrapper { 
    max-width: 450px !important; 
    margin: 15px auto !important; 
}
.np-auth-card { 
    padding: 0 !important; 
    overflow: hidden !important; 
}
.np-auth-tabs { 
    display: flex !important; 
    background: #f5f5f5 !important; 
    border-bottom: 1px solid #e0e0e0 !important; 
}
.np-auth-tabs a { 
    flex: 1 !important; 
    text-align: center !important; 
    padding: 16px !important; 
    text-decoration: none !important; 
    color: #666 !important; 
    font-weight: 600 !important; 
    border-right: 1px solid #e0e0e0 !important; 
    background: #f5f5f5 !important; 
}
.np-auth-tabs a.active { 
    background: #ffffff !important; 
    color: #3366cc !important; 
    border-bottom: 3px solid #3366cc !important; 
}
.np-auth-content { 
    padding: 35px !important; 
    background: #fff !important; 
}

/* Zakładki - border-radius na 0 */
.np-tabs { 
    display: flex !important; 
    gap: 5px !important; 
    margin-bottom: 15px !important; 
    border-bottom: 1px solid #ddd !important; 
}
.np-tab { 
    padding: 10px 20px !important; 
    text-decoration: none !important; 
    border: 1px solid transparent !important; 
    border-bottom: none !important; 
    border-radius: 0px 0px 0 0 !important; 
    margin-bottom: -1px !important; 
    font-weight: 500 !important; 
}

/* Pola - border-radius na 0 */
.np-field { 
    margin-bottom: 10px !important; 
}
.np-field label { 
    display: block !important; 
    font-weight: 600 !important; 
    margin-bottom: 8px !important; 
    color: #333 !important; 
}
.np-field input[type="text"], 
.np-field input[type="email"], 
.np-field input[type="password"], 
.np-field input[type="url"], 
.np-field textarea, 
.np-field select { 
    width: 100% !important; 
    padding: 10px 12px !important; 
    border: 1px solid #ccc !important; 
    border-radius: 4px !important; 
    background: #fff !important; 
}
.np-pass-wrapper { 
    position: relative !important; 
    display: block !important; 
}
.np-pass-wrapper input { 
    padding-right: 40px !important; 
}
.np-pass-toggle { 
    position: absolute !important; 
    top: 50% !important; 
    right: 10px !important; 
    transform: translateY(-50%) !important; 
    cursor: pointer !important; 
    color: #888 !important; 
    z-index: 5 !important; 
    font-size: 20px !important; 
}

.np-footer-container { 
    margin-top: 40px !important; 
    padding-top: 20px !important; 
    border-top: 1px solid #eaeaea !important; 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
    font-size: 13px !important; 
    color: #777 !important; 
    width: 100% !important; 
}
.np-footer-left img { 
    height: 28px !important; 
    width: auto !important; 
    opacity: 0.8; 
}
.np-footer-right a { 
    color: #555 !important; 
    text-decoration: none !important; 
    font-weight: 500 !important; 
}
.np-report-link { 
    color: #d63638 !important; 
}

/* Tabela i odznaki - border-radius na 0 */
.np-table { 
    width: 100% !important; 
    border-collapse: separate !important; 
    border-spacing: 0 !important; 
    border: 1px solid #e5e5e5 !important; 
    border-radius: 0px !important; 
    overflow: hidden !important; 
    margin-bottom: 0 !important; 
    background: #fff !important; 
}
.np-table th { 
    background: #f8f9fa !important; 
    padding: 15px !important; 
    text-align: left !important; 
    font-weight: 600 !important; 
    border-bottom: 1px solid #e5e5e5 !important; 
    color: #333 !important; 
}
.np-table td { 
    padding: 15px !important; 
    border-bottom: 1px solid #eee !important; 
    vertical-align: middle !important; 
    color: #555 !important; 
}
.np-badge { 
    display: inline-block; 
    padding: 4px 8px; 
    border-radius: 0px; 
    font-size: 11px; 
    font-weight: 700; 
    text-transform: uppercase; 
    background: #f0f0f1; 
    color: #666; 
}
.np-action-buttons { 
    display: flex !important; 
    gap: 5px !important; 
}
.np-action-buttons .np-btn { 
    height: 32px !important; 
    padding: 0 12px !important; 
    font-size: 13px !important; 
}

/* Powiadomienia - border-radius na 0 */
#np-messages, #np-profile-msg, #np-auth-msg { 
    margin-bottom: 20px !important; 
}
.np-success { 
    background: #d4edda !important; 
    color: #155724 !important; 
    padding: 12px !important; 
    border-radius: 0px; 
    border: 1px solid #c3e6cb !important; 
}
.np-error { 
    background: #f8d7da !important; 
    color: #721c24 !important; 
    padding: 12px !important; 
    border-radius: 0px; 
    border: 1px solid #f5c6cb !important; 
}

/* ==========================================================================
   ZAPORA ANTY-FLATSOME (WYMUSZENIE RWD I CZYSTEGO WYGLĄDU SYNAPSE)
   ========================================================================== */

/* 1. Ochrona kontenerów i fieldsetów (Flatsome psuje flexboxa i fieldsety) */
.woocommerce-MyAccount-content .neuropost-wrapper fieldset,
.woocommerce-MyAccount-content #synapse-fe-panel fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
    background: transparent !important;
    min-width: 0 !important;
}

/* 2. Ochrona nagłówków (Legend) wewnątrz Synapse Panel */
.woocommerce-MyAccount-content .neuropost-wrapper legend,
.woocommerce-MyAccount-content #synapse-fe-panel legend {
    font-size: 1.17em !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
    padding: 0 !important;
    border: none !important;
    display: block !important;
    width: 100% !important;
    background: transparent !important;
    color: #333 !important;
}

/* 3. Ochrona Checkboxów (Flatsome często je ukrywa opacity:0 i rysuje customowe ::before) */
.woocommerce-MyAccount-content #synapse-fe-panel input[type="checkbox"] {
    position: static !important;
    opacity: 1 !important;
    margin-right: 8px !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    clip: auto !important;
}

/* 4. Blokada pseudoelementów motywu na labelach */
.woocommerce-MyAccount-content #synapse-fe-panel label {
    display: block !important;
    margin-bottom: 4px !important;
    font-weight: bold !important;
    position: relative !important;
    padding-left: 0 !important;
}
.woocommerce-MyAccount-content #synapse-fe-panel label::before,
.woocommerce-MyAccount-content #synapse-fe-panel label::after {
    display: none !important;
}

/* 5. Wymuszenie czystego Input Text w Synapse TOTP (Flatsome rozciąga wysokość) - border-radius na 0 */
.woocommerce-MyAccount-content #synapse-fe-panel input[type="text"] {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
    border-radius: 0px !important;
    box-shadow: none !important;
    height: 36px !important;
    line-height: 36px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    max-width: 100% !important;
}

/* 6. Naprawa ucinających się tekstów na Mobile (RWD dla panelu metod) */
@media (max-width: 768px) {
    .np-header-nav { justify-content: center !important; }
    .np-row { flex-direction: column !important; }
    
    #synapse-fe-panel > div {
        flex-direction: column !important;
        gap: 20px !important;
    }
    #synapse-fe-panel fieldset,
    #synapse-fe-panel > div > div {
        width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
    }
}