/* =========================================
   PCB & NET SALARY CALCULATOR
   Shared form styles (.df-calc-box, .input-wrapper, .df-btn-primary)
   come from the theme; this file only adds what is specific to PCB.
   ========================================= */

/* --- LEFT: FORM --- */

.df-pcb-box .df-pcb-section {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #D1DEEE;
}

.df-pcb-box .df-pcb-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.df-pcb-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0 !important;
    font-family: Inter, sans-serif;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #0F2855 !important;
    line-height: 1.4;
}

.df-pcb-step small {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

.df-pcb-step-no {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #148DFB;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.df-pcb-box .df-input-group {
    margin-bottom: 16px;
}

.df-pcb-box .df-input-group:last-child {
    margin-bottom: 0;
}

.df-pcb-box select {
    background-color: #F3F3F3;
    font-size: 15px;
    font-weight: 400;
    color: #0F2855;
    min-height: 44px;
}

.df-pcb-error {
    display: none;
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

.df-pcb-box .input-wrapper.has-error {
    box-shadow: 0 0 0 1px #ef4444;
}

.df-pcb-box .input-wrapper.is-readonly input {
    color: #0F2855;
    cursor: default;
}

/* Residency segmented control */
.df-pcb-segment {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #F3F3F3;
    border-radius: 8px;
    margin-bottom: 16px;
}

.df-pcb-seg-btn {
    flex: 1;
    border: none !important;
    background: transparent !important;
    color: #0F2855 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 8px 10px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.df-pcb-seg-btn.active {
    background: #148DFB !important;
    color: #fff !important;
}

.df-pcb-note {
    font-size: 13px;
    color: #475569;
    text-align: center;
    margin: 0 0 4px 0;
}

.df-pcb-note-left {
    text-align: left;
    margin: -4px 0 16px 0;
}

/* Resident / non-resident visibility */
.df-pcb-nonres-only,
.df-pcb-box.is-nonresident .df-pcb-res-only {
    display: none;
}

.df-pcb-box.is-nonresident .df-pcb-nonres-only {
    display: block;
}

/* Children dropdowns */
.df-pcb-kids {
    display: flex;
    gap: 12px;
}

.df-pcb-kids .df-input-group {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.df-pcb-kids label {
    white-space: nowrap;
}

/* Tooltip */
.df-pcb-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    border: 1px solid #64748b;
    border-radius: 50%;
    font-size: 8px;
    font-weight: 700;
    font-style: normal;
    color: #64748b;
    cursor: help;
    vertical-align: middle;
}

.df-pcb-tip-text {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    padding: 4px 6px;
    background: #364156;
    color: #fff;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.3;
    white-space: normal;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    z-index: 5;
}

.df-pcb-tip:hover .df-pcb-tip-text,
.df-pcb-tip:focus .df-pcb-tip-text {
    opacity: 1;
    visibility: visible;
}

/* Custom EPF rate */
.df-pcb-epf-custom {
    display: none;
}

.df-pcb-box.is-epf-custom .df-pcb-epf-custom {
    display: block;
}

/* SOCSO / EIS switches */
.df-pcb-switches {
    display: flex;
    gap: 16px;
}

.df-pcb-switch {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background: #F3F3F3;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 !important;
    cursor: pointer;
    position: relative;
}

.df-pcb-switch-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #0F2855;
}

.df-pcb-switch-text small {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.df-pcb-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.df-pcb-slider {
    flex: 0 0 36px;
    width: 36px;
    height: 20px;
    border-radius: 20px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.2s;
}

.df-pcb-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.df-pcb-switch input:checked + .df-pcb-slider {
    background: #148DFB;
}

.df-pcb-switch input:checked + .df-pcb-slider::after {
    transform: translateX(16px);
}

.df-pcb-switch input:focus-visible + .df-pcb-slider {
    box-shadow: 0 0 0 2px #bfdbfe;
}

/* Tax reliefs accordion */
.df-pcb-accordion {
    width: 100%;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: left;
    cursor: pointer;
}

.df-pcb-chevron {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #364156;
    border-bottom: 1.5px solid #364156;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.df-pcb-accordion[aria-expanded="true"] .df-pcb-chevron {
    transform: rotate(-135deg);
}

.df-pcb-reliefs-body {
    padding-top: 16px;
}

.df-pcb-help {
    font-size: 13px;
    color: #475569;
    margin: 0 0 16px 0;
}

.df-pcb-relief-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.df-pcb-relief-row .input-wrapper {
    flex: 0 0 58%;
}

.df-pcb-cap {
    flex: 1;
    text-align: right;
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
}

.df-pcb-box .df-btn-primary {
    margin-top: 24px;
}

/* Related calculator link card (under the form) */
.df-pcb-related {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 530px;
    margin: 16px auto 0;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 18px 0 rgba(66, 147, 247, 0.15);
    color: #0F2855 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 600;
    box-sizing: border-box;
}

.df-pcb-related-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E7F2FF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.df-pcb-related-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.df-pcb-related-text {
    flex: 1;
}

.df-pcb-related-arrow {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid #364156;
    border-top: 1.5px solid #364156;
    transform: rotate(45deg);
}

.df-pcb-related:hover {
    box-shadow: 0 3px 18px 0 rgba(66, 147, 247, 0.3);
}

/* --- RIGHT: RESULTS --- */

.df-pcb-results {
    font-family: Inter, sans-serif;
    width: 100%;
    max-width: 655px;
    opacity: 0.5;
    transition: opacity 0.5s ease-in-out;
}

.df-pcb-results.is-calculated {
    opacity: 1;
}

.df-pcb-results-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 40px;
}

.df-pcb-results-title {
    color: #fff !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
}

.df-pcb-net-wrap {
    text-align: right;
}

.df-pcb-net-label {
    display: block;
    color: #FFD84B;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.df-pcb-net {
    display: block;
    color: #fff;
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.df-pcb-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Stacked bar */
.df-pcb-bar {
    display: flex;
    height: 26px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 24px;
}

.df-pcb-bar .seg {
    height: 100%;
    width: 0;
    transition: width 0.5s ease;
}

.df-pcb-bar .seg-net {
    width: 100%;
    background: #148DFB;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.df-pcb-bar .seg-net em {
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    padding-left: 12px;
    white-space: nowrap;
}

.seg-epf, .dot-epf { background: #FFD166; }
.seg-socso, .dot-socso { background: #6EE7B7; }
.seg-eis, .dot-eis { background: #93C5FD; }
.seg-pcb, .dot-pcb { background: #FCA5A5; }

.df-pcb-card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0F2855 !important;
    margin: 0 0 8px 0 !important;
}

/* Deductions list */
.df-pcb-deductions {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.df-pcb-deductions li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #0F2855;
    margin: 0;
}

.df-pcb-deductions li.total {
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 600;
}

.df-pcb-deductions .dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.df-pcb-deductions .name {
    flex: 1;
}

.df-pcb-deductions .name small {
    display: none;
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.df-pcb-deductions .pct {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
    min-width: 48px;
    text-align: right;
}

.df-pcb-deductions .amt {
    font-weight: 600;
    min-width: 110px;
    text-align: right;
    white-space: nowrap;
}

/* Tax at a glance */
.df-pcb-glance-title {
    margin-top: 32px !important;
    margin-bottom: 16px !important;
}

.df-pcb-glance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    padding: 24px 20px;
}

.df-pcb-glance span {
    display: block;
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
}

.df-pcb-glance strong {
    font-size: 16px;
    font-weight: 600;
    color: #0F2855;
}

/* Share */
.df-pcb-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 13px;
    color: #fff;
}

.df-pcb-share button,
.df-pcb-share a {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    cursor: pointer;
    text-decoration: none !important;
    line-height: 1.4;
}

.df-pcb-share button:hover,
.df-pcb-share a:hover {
    background: rgba(255, 255, 255, 0.28) !important;
}

.df-pcb-results:not(.is-calculated) .df-pcb-share {
    display: none;
}

.df-pcb-disclaimer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-top: 16px;
}

/* --- ARTICLE: TABLES (salary table + static article tables) --- */

.df-pcb-table-wrap {
    overflow-x: auto;
    border: 1px solid #D1DEEE;
    border-radius: 12px;
    margin-bottom: 24px;
}

.df-pcb-salary-table,
.df-pcb-article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 !important;
    font-size: 14px;
    border: none !important;
}

.df-pcb-salary-table th,
.df-pcb-salary-table td,
.df-pcb-article-table th,
.df-pcb-article-table td {
    padding: 14px 16px !important;
    text-align: right;
    color: #364156;
    border: none !important;
    border-bottom: 1px solid #E5EDF7 !important;
    white-space: nowrap;
    background: transparent !important;
}

.df-pcb-salary-table th:first-child,
.df-pcb-salary-table td:first-child,
.df-pcb-article-table th:first-child,
.df-pcb-article-table td:first-child {
    text-align: left;
}

.df-pcb-salary-table thead th,
.df-pcb-article-table thead th {
    background: #E3F1FE !important;
    color: #0F2855;
    font-weight: 600;
}

.df-pcb-salary-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.df-pcb-salary-table tbody tr:last-child td,
.df-pcb-article-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Formula box ("Net Pay = Gross Salary - ...") */
.df-pcb-formula {
    background: #E7F2FF;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 0 0 16px 0;
    text-align: center;
    font-weight: 600 !important;
    color: #0F2855 !important;
}

.df-pcb-salary-table tbody tr:hover td {
    background: #F5FAFF !important;
}

.df-pcb-salary-table tbody tr.is-highlight td {
    background: #EEF6FF !important;
    font-weight: 600;
    color: #0F2855;
}

.df-pcb-salary-table td a {
    color: inherit !important;
    text-decoration: none !important;
}

.df-pcb-salary-table td strong {
    color: #0F2855;
}

/* --- RESPONSIVE --- */

@media (max-width: 767px) {
    .df-pcb-seg-btn {
        font-size: 12px !important;
        padding: 8px 4px !important;
        white-space: nowrap;
    }

    .df-pcb-kids {
        flex-direction: column;
        gap: 16px;
    }

    .df-pcb-kids .df-input-group {
        margin-bottom: 0;
    }

    .df-pcb-results-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        margin-bottom: 24px;
    }

    .df-pcb-net-wrap {
        text-align: left;
    }

    .df-pcb-net-label {
        font-size: 14px;
    }

    .df-pcb-net {
        font-size: 32px;
    }

    .df-pcb-card {
        padding: 20px;
    }

    .df-pcb-deductions li {
        gap: 8px;
        font-size: 14px;
    }

    .df-pcb-deductions .name small {
        display: block;
        margin-top: 2px;
    }

    .df-pcb-deductions .amt {
        min-width: 0;
    }

    .df-pcb-glance {
        gap: 16px;
    }

    .df-pcb-salary-table,
    .df-pcb-article-table {
        font-size: 13px;
    }

    .df-pcb-salary-table th,
    .df-pcb-salary-table td,
    .df-pcb-article-table th,
    .df-pcb-article-table td {
        padding: 12px 10px !important;
    }
}

@media (max-width: 400px) {
    .df-pcb-relief-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .df-pcb-relief-row .input-wrapper {
        flex: none;
    }

    .df-pcb-cap {
        text-align: left;
    }

    .df-pcb-switches {
        gap: 10px;
    }

    .df-pcb-switch {
        padding: 12px;
    }
}
