/* ============================================================
   Brutto-Netto Generator – Front-end styles
   ============================================================ */

/* ---------- layout helpers ---------------------------------- */
.bn-section {
    margin: 2rem 0;
}
.bn-quick-answer {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

/* ---------- interactive calculator ------------------------- */
.bn-calculator {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 680px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.bn-calc-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.bn-input-group {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 160px;
    flex: 1;
}
.bn-input-group label {
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
}
.bn-input-group input[type="number"],
.bn-input-group select {
    padding: .5rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    height: 2.75rem;
    box-sizing: border-box;
}
.bn-input-group input[type="checkbox"] {
    margin-right: .4rem;
}

/* result hero */
.bn-calc-result {
    background: #0f172a;
    color: #fff;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.bn-result-label { font-size: .85rem; opacity: .7; }
.bn-result-net   { font-size: 2rem; font-weight: 700; }
.bn-result-rate  { font-size: .85rem; opacity: .7; }

/* ---------- breakdown tables ------------------------------- */
.bn-mini-table,
.bn-breakdown-table,
.bn-compare-table,
.bn-range-table,
.bn-context-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
    margin: 1rem 0;
}
.bn-mini-table th,
.bn-mini-table td,
.bn-breakdown-table th,
.bn-breakdown-table td,
.bn-compare-table th,
.bn-compare-table td,
.bn-range-table th,
.bn-range-table td,
.bn-context-table th,
.bn-context-table td {
    padding: .55rem .75rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}
.bn-breakdown-table th,
.bn-compare-table th,
.bn-range-table th,
.bn-context-table th {
    background: #f8fafc;
    font-weight: 600;
}
.bn-deduction td:first-child { color: #64748b; }
.bn-deduction td:last-child   { color: #dc2626; }
.bn-net-row td { background: #f0fdf4; font-weight: 700; color: #166534; }
.bn-highlight td { background: #fef9c3; font-weight: 700; }

/* ---------- contract details ------------------------------- */
.bn-contract-details { margin-top: 1.5rem; }
.bn-contract-details h3 { font-size: 1rem; margin-bottom: .4rem; }

/* ---------- FAQ -------------------------------------------- */
.bn-faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
}
.bn-faq-item h3 {
    font-size: 1rem;
    margin: 0 0 .5rem;
    color: #0f172a;
    cursor: pointer;
}
.bn-faq-item h3::before {
    content: 'Q: ';
    color: #0ea5e9;
    font-weight: 700;
}

/* ---------- homepage FAQ accordion (<details>/<summary>) --- */
.bn-faq-details:first-of-type { border-top: 1px solid #e2e8f0; }
.bn-faq-details { border-bottom: 1px solid #e2e8f0; }
.bn-faq-details summary {
    list-style: none;
    display: flex;
    align-items: center;
    min-height: 44px;        /* WCAG touch target */
    padding: .75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
}
.bn-faq-details summary::-webkit-details-marker { display: none; }
.bn-faq-details summary::before {
    content: '+';
    color: #0ea5e9;
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: .65rem;
    flex-shrink: 0;
}
.bn-faq-details[open] summary::before { content: '−'; }
.bn-faq-details .bn-faq-a {
    padding: 0 1rem .9rem 2.6rem;
    color: #334155;
    font-size: .92rem;
    line-height: 1.7;
}

/* ---------- related list ----------------------------------- */
.bn-related-list { columns: 2; column-gap: 2rem; }
.bn-related-list li { margin-bottom: .4rem; }

/* ---------- update notice ---------------------------------- */
.bn-update-notice {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: .75rem 1rem;
    font-size: .85rem;
    color: #64748b;
    margin-top: 2rem;
}
.bn-note { font-size: .82rem; color: #64748b; font-style: italic; }
.bn-disclaimer {
    font-size: .78rem;
    color: #94a3b8;
    margin-top: 1rem;
    padding: .6rem .9rem;
    border-left: 3px solid #e2e8f0;
    line-height: 1.6;
}

/* ── Scroll wrapper (context, range, breakdown on desktop) ── */
.bn-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin: 1rem 0;
}
.bn-table-wrap table { margin: 0; }

/* ---------- responsive ------------------------------------- */
@media (max-width: 600px) {
    .bn-calc-inputs  { flex-direction: column; }
    .bn-related-list { columns: 1; }
    .bn-result-net   { font-size: 1.1rem; }

    /* Hide Opis column in breakdown — Składnik + Kwota is sufficient */
    .bn-col-desc { display: none; }

    /* Compare table: stacked card layout, no scrolling */
    .bn-compare-table thead { display: none; }
    .bn-compare-table tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 1rem;
        overflow: hidden;
    }
    .bn-compare-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        padding: .5rem .75rem;
        font-size: .9rem;
        text-align: right;
    }
    .bn-compare-table td:last-child { border-bottom: none; }
    .bn-compare-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: .78rem;
        text-transform: uppercase;
        letter-spacing: .04em;
        margin-right: .75rem;
        flex-shrink: 0;
        text-align: left;
    }
    /* Contract name row — centred header style, no label */
    .bn-compare-table td:first-child {
        background: #f8fafc;
        justify-content: center;
        font-size: 1rem;
        text-align: center;
    }
    .bn-compare-table td:first-child::before { display: none; }
}
