:root {
    --page-bg: #eef1f5;
    --card-bg: #ffffff;
    --text: #262a31;
    --muted: #727780;
    --line: #e4e7eb;
    --blue: #247dcc;
    --blue-dark: #22628f;
    --form-blue: #2f65d9;
    --soft-blue: #edf5fc;
    --warning: #fff7dd;
    --danger: #a72828;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page-bg);
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    color: var(--text);
    background: var(--page-bg);
}

button,
input,
select {
    font: inherit;
}

.page-width {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}


/*
 * HEADER
 */

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark,
.payslip-logo {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border: 3px solid var(--blue);
    border-radius: 50%;

    font-weight: 800;
    color: var(--blue);
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}


/*
 * INTRO
 */

.intro {
    padding-top: 52px;
    padding-bottom: 24px;
}

.eyebrow {
    color: var(--form-blue);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.intro h1 {
    font-size: clamp(
        38px,
        6vw,
        64px
    );

    line-height: 1;
    letter-spacing: -.04em;

    margin:
        10px
        0
        18px;

    max-width: 800px;
}

.intro p {
    max-width: 700px;
    line-height: 1.6;
    color: var(--muted);
    font-size: 17px;
}


/*
 * FORM
 */

.calculator-form {
    margin-bottom: 50px;
}

.form-card {
    background: #fff;

    border:
        1px solid
        var(--line);

    border-radius: 18px;

    padding: 26px;

    margin-bottom: 16px;
}

.form-card h2 {
    margin:
        0
        0
        20px;

    font-size: 21px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    font-size: 13px;
    font-weight: 700;
}

.form-grid label small {
    color: var(--muted);
    font-weight: 400;
}

input,
select {
    width: 100%;

    padding:
        12px
        13px;

    background: #fff;

    border:
        1px solid
        #ced4dd;

    border-radius: 9px;

    color: var(--text);

    outline: none;
}

input:focus,
select:focus {
    border-color: var(--form-blue);

    box-shadow:
        0 0 0 3px
        rgba(
            47,
            101,
            217,
            .1
        );
}

.checkbox-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px 20px;

    margin-top: 20px;
}

.checkbox {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 9px;

    font-size: 13px;
    line-height: 1.4;

    cursor: pointer;
}

.checkbox input {
    width: auto;
    margin-top: 2px;
}

.form-help {
    margin:
        -8px
        0
        20px;

    color: var(--muted);
    font-size: 13px;
}

.calculate-button {
    width: 100%;

    border: none;

    background: var(--form-blue);
    color: #fff;

    border-radius: 11px;

    padding: 16px 20px;

    font-weight: 800;
    font-size: 16px;

    cursor: pointer;
}

.calculate-button:hover {
    filter: brightness(.96);
}

.message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.message.error {
    background: #fff1f1;
    color: var(--danger);
}


/*
 * RESULT ACTIONS
 */

.result-actions {
    display: flex;
    justify-content: flex-end;

    margin:
        20px
        0
        12px;
}

.result-actions button {
    background: #fff;
    color: var(--form-blue);

    border:
        1px solid
        #cbd7f6;

    border-radius: 9px;

    padding:
        10px
        15px;

    font-weight: 700;

    cursor: pointer;
}


/*
 * PAYSLIP
 */

.payslip {
    background: #fff;

    max-width: 960px;

    margin:
        0
        auto
        50px;

    box-shadow:
        0 12px 45px
        rgba(
            28,
            38,
            55,
            .10
        );
}

.payslip-header {
    min-height: 210px;

    display: flex;
    justify-content: space-between;

    padding:
        42px
        52px
        30px;

    border-bottom:
        1px solid
        #edf0f3;
}

.payslip-company {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.payslip-company strong {
    display: block;
    font-size: 22px;
}

.payslip-company small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
}

.employee-info {
    display: grid;
    gap: 12px;

    min-width: 260px;
}

.employee-info > div {
    display: grid;

    grid-template-columns:
        120px
        1fr;

    gap: 12px;

    font-size: 12px;
}

.employee-info span {
    color: var(--muted);
}

.employee-info strong {
    font-weight: 600;
}


/*
 * PERIOD
 */

.payslip-period {
    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 20px;

    padding:
        22px
        52px;

    background: #f8f9fa;

    border-bottom:
        1px solid
        #edf0f3;
}

.payslip-period > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.payslip-period strong {
    font-size: 13px;
}

.payout-box {
    text-align: right;
}

.payout-box strong {
    font-size: 24px;
    color: var(--blue-dark);
}

.payout-box strong small {
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
}


/*
 * EMPLOYMENT META
 */

.employment-meta {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            1fr
        );

    gap: 18px;

    padding:
        20px
        52px;

    border-bottom:
        1px solid
        #edf0f3;
}

.employment-meta span {
    display: block;

    color: var(--muted);

    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;

    margin-bottom: 5px;
}

.employment-meta strong {
    font-size: 12px;
}


/*
 * PAY LINES
 */

.pay-lines {
    padding:
        12px
        52px
        40px;
}

.pay-lines table {
    width: 100%;
    border-collapse: collapse;
}

.pay-lines thead th {
    padding:
        14px
        8px
        10px;

    text-align: right;

    font-size: 12px;
    font-weight: 800;

    border-bottom:
        1px solid
        #e8ebef;
}

.pay-lines thead th.description {
    text-align: left;
}

.pay-lines tbody td {
    padding:
        8px;

    font-size: 12px;

    vertical-align: top;

    text-align: right;
}

.pay-lines tbody td.description {
    text-align: left;
}

.pay-lines tbody tr.deduction td:last-child {
    color: #4f555d;
}

.pay-lines tbody tr.saving td {
    color: #5f6670;
}

.pay-lines tbody tr.sub-info td {
    color: #888e96;
    padding-top: 3px;
    padding-bottom: 3px;
}

.pay-lines tfoot th {
    border-top:
        1px solid
        #dfe3e8;

    padding:
        15px
        8px
        0;

    text-align: right;

    font-size: 13px;
}

.pay-lines tfoot th:last-child {
    color: var(--blue-dark);
    font-size: 15px;
}


/*
 * BOTTOM OVERVIEW
 */

.bottom-overview {
    background: #f8f9fa;

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 34px;

    padding:
        30px
        52px;
}

.overview-block {
    border-left:
        3px solid
        var(--blue);

    padding-left: 12px;
}

.overview-block h3 {
    font-size: 11px;

    margin:
        0
        0
        7px;

    letter-spacing: .04em;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table td {
    font-size: 10px;

    padding:
        2px
        0;

    color: #555b63;
}

.mini-table td:last-child {
    text-align: right;
}

.mini-table .total-row td {
    padding-top: 5px;
    font-weight: 800;
    color: var(--text);
}


/*
 * FOOTER
 */

.payslip-footer {
    min-height: 55px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding:
        0
        52px;

    font-size: 10px;
    color: #777d85;
}

.calculation-note {
    max-width: 960px;

    margin:
        -25px
        auto
        60px;

    padding:
        16px;

    background: var(--warning);

    border-radius: 10px;

    font-size: 12px;
}

.calculation-note p {
    margin:
        6px
        0
        0;

    line-height: 1.5;
}


/*
 * MOBILE
 */

@media (
    max-width: 780px
) {

    .page-width {
        padding-left: 14px;
        padding-right: 14px;
    }

    .form-grid,
    .checkbox-grid {
        grid-template-columns:
            1fr;
    }

    .payslip {
        overflow-x: auto;
    }

    .payslip-header {
        flex-direction: column;
        gap: 35px;

        padding:
            30px
            24px;
    }

    .employee-info {
        min-width: 0;
    }

    .payslip-period {
        grid-template-columns:
            1fr;

        padding:
            20px
            24px;
    }

    .payout-box {
        text-align: left;
    }

    .employment-meta {
        grid-template-columns:
            1fr
            1fr;

        padding:
            18px
            24px;
    }

    .pay-lines {
        overflow-x: auto;

        padding:
            10px
            24px
            30px;
    }

    .pay-lines table {
        min-width: 650px;
    }

    .bottom-overview {
        grid-template-columns:
            1fr;

        padding:
            25px
            24px;
    }

    .payslip-footer {
        padding:
            0
            24px;
    }
}


/*
 * PRINT / PDF
 */

@media print {

    @page {
        size: A4;
        margin: 8mm;
    }

    html,
    body {
        background: #fff;
    }

    .no-print,
    .site-header {
        display: none !important;
    }

    .page-width {
        max-width: none;
        padding: 0;
    }

    .payslip {
        width: 100%;
        max-width: none;

        margin: 0;

        box-shadow: none;
    }

    .payslip-header {
        padding:
            28px
            34px
            22px;
    }

    .payslip-period,
    .employment-meta,
    .bottom-overview {
        -webkit-print-color-adjust:
            exact;

        print-color-adjust:
            exact;
    }

    .pay-lines {
        padding:
            10px
            34px
            28px;
    }

    .bottom-overview {
        padding:
            24px
            34px;
    }

    .payslip-footer {
        padding:
            0
            34px;
    }
}