/*
 * Work & Pay
 * Shared stylesheet for all calculators and the main page
 */


/* =========================================================
   RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    background: #f5f7fa;
    color: #1f2937;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.6;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}


/* =========================================================
   HEADER
   ========================================================= */

header {
    width: 100%;

    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    width: 100%;
    max-width: 1100px;

    margin: 0 auto;
    padding: 20px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}


/* =========================================================
   LOGO
   ========================================================= */

.logo {
    color: #111827;

    font-size: 24px;
    font-weight: 700;

    text-decoration: none;
    letter-spacing: -0.4px;
}

.logo:hover {
    color: #2563eb;
}


/* =========================================================
   TAGLINE
   ========================================================= */

.tagline {
    color: #6b7280;

    font-size: 14px;
    text-align: right;
}


/* =========================================================
   MAIN
   ========================================================= */

main {
    width: 100%;
    max-width: 900px;

    margin: 0 auto;
    padding: 40px 24px 60px;
}


/* =========================================================
   INTRO
   ========================================================= */

.intro {
    margin-bottom: 28px;
}

.intro h1 {
    margin: 0 0 8px;

    color: #111827;

    font-size: 36px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: -0.7px;
}

.intro p {
    margin: 0;

    color: #6b7280;

    font-size: 17px;
}


/* =========================================================
   CARD
   ========================================================= */

.card {
    margin-bottom: 24px;
    padding: 28px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.04);
}


/* =========================================================
   CALCULATOR INDEX
   ========================================================= */

.calculator-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;

    margin-bottom: 24px;
}

.calculator-card {
    display: block;

    padding: 24px;

    color: inherit;
    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.04);

    text-decoration: none;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.calculator-card:hover {
    transform: translateY(-2px);

    border-color: #d1d5db;

    box-shadow:
        0 6px 18px rgba(15, 23, 42, 0.08);
}

.calculator-card:focus-visible {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.14);
}

.us-calculator {
    grid-column: 1 / -1;

    width: calc(50% - 10px);
    justify-self: center;

    margin-top: 10px;

    border-color: #bfdbfe;
    box-shadow:
        0 3px 10px rgba(37, 99, 235, 0.06);
}

.us-calculator:hover {
    border-color: #93c5fd;

    box-shadow:
        0 7px 20px rgba(37, 99, 235, 0.10);
}

.calculator-title {
    margin: 0 0 8px;

    color: #111827;

    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;

    letter-spacing: -0.2px;
}

.calculator-description {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
    line-height: 1.6;
}

.calculator-link {
    display: inline-block;

    margin-top: 17px;

    color: #2563eb;

    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   SECTION TITLES
   ========================================================= */

.section-title {
    margin: 0 0 22px;

    color: #111827;

    font-size: 21px;
    line-height: 1.3;
    font-weight: 700;
}


/* =========================================================
   SETTINGS / FORM GRID
   ========================================================= */

.settings {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}


/* =========================================================
   FIELD
   ========================================================= */

.field {
    min-width: 0;
}

.field label {
    display: block;

    margin-bottom: 7px;

    color: #374151;

    font-size: 14px;
    font-weight: 600;
}
/* =========================================================
   COPY BUTTON
   ========================================================= */

.copy-row {
    grid-column: 1 / -1;

    margin-top: -8px;

    display: flex;
    justify-content: flex-end;
}

.copy-button {
    padding: 7px 12px;

    color: #3730a3;
    background: #eef2ff;

    border: 1px solid #c7d2fe;
    border-radius: 7px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.copy-button:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.copy-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.14);
}


/* =========================================================
   INPUTS AND SELECTS
   ========================================================= */

.field input,
.field select {
    width: 100%;
    height: 44px;

    padding: 9px 12px;

    color: #111827;
    background: #ffffff;

    border: 1px solid #d1d5db;
    border-radius: 7px;

    font-family: inherit;
    font-size: 15px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.field input:hover,
.field select:hover {
    border-color: #9ca3af;
}

.field input:focus,
.field select:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field input:disabled,
.field select:disabled {
    color: #6b7280;
    background: #f3f4f6;
    cursor: not-allowed;
}


/* =========================================================
   INPUT HELP
   ========================================================= */

.input-help {
    margin-top: 5px;

    color: #6b7280;

    font-size: 12px;
    line-height: 1.4;
}


/* =========================================================
   HIDDEN
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   OPTIONAL SECTIONS
   ========================================================= */

.optional {
    margin-top: 28px;
    padding-top: 24px;

    border-top: 1px solid #e5e7eb;
}

.optional-title {
    margin: 0 0 16px;

    color: #374151;

    font-size: 16px;
    font-weight: 700;
}


/* =========================================================
   DEPENDENT HELP
   ========================================================= */

.dependent-help {
    margin-top: 14px;

    color: #6b7280;

    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.buttons {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-top: 30px;
}


/* =========================================================
   GENERAL BUTTON
   ========================================================= */

.buttons button {
    min-height: 44px;

    padding: 10px 22px;

    border-radius: 7px;

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.buttons button:active {
    transform: translateY(1px);
}

.buttons button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   CALCULATE BUTTON
   ========================================================= */

.buttons .calculate {
    color: #ffffff;

    background: #2563eb;

    border: 1px solid #2563eb;
}

.buttons .calculate:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.buttons .calculate:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.18);
}


/* =========================================================
   RESET BUTTON
   ========================================================= */

.buttons .reset {
    color: #374151;

    background: #ffffff;

    border: 1px solid #d1d5db;
}

.buttons .reset:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.buttons .reset:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(107, 114, 128, 0.14);
}


/* =========================================================
   RESULTS
   ========================================================= */

.results {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


/* =========================================================
   RESULT BOX
   ========================================================= */

.result-box {
    min-height: 96px;

    padding: 17px 18px;

    background: #f9fafb;

    border: 1px solid #e5e7eb;
    border-radius: 9px;
}


/* =========================================================
   RESULT LABEL
   ========================================================= */

.result-label {
    margin-bottom: 6px;

    color: #6b7280;

    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   RESULT VALUE
   ========================================================= */

.result-value {
    color: #111827;

    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;

    letter-spacing: -0.2px;
}

.result-value.deduction {
    color: #b42318;
}


/* =========================================================
   HIGHLIGHT
   ========================================================= */

.result-box.highlight {
    grid-column: 1 / -1;

    background: #eff6ff;

    border-color: #bfdbfe;
}

.result-box.highlight .result-label {
    color: #1d4ed8;

    font-weight: 600;
}

.result-box.highlight .result-value {
    color: #1d4ed8;

    font-size: 28px;
}


/* =========================================================
   PAY BOX
   ========================================================= */

.result-box.pay {
    background: #f9fafb;
}


/* =========================================================
   ESTIMATE NOTE
   ========================================================= */

.estimate-note {
    margin-top: 22px;
    padding: 16px 18px;

    color: #4b5563;
    background: #f9fafb;

    border-left: 4px solid #9ca3af;

    font-size: 13px;
    line-height: 1.6;
}

.estimate-note strong {
    color: #374151;
}


/* =========================================================
   BREAKDOWN
   ========================================================= */

.breakdown {
    margin-top: 24px;

    border-top: 1px solid #e5e7eb;
}

.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 13px 0;

    border-bottom: 1px solid #e5e7eb;

    color: #4b5563;

    font-size: 14px;
}

.breakdown-row span:first-child {
    min-width: 0;
}

.breakdown-row span:last-child {
    flex-shrink: 0;

    color: #111827;

    font-weight: 600;
    text-align: right;
}


/* =========================================================
   INFORMATION CARD
   ========================================================= */

.card.info {
    color: #4b5563;
}

.card.info > strong {
    display: block;

    margin-bottom: 12px;

    color: #111827;

    font-size: 18px;
}

.card.info p {
    margin: 0 0 14px;

    font-size: 14px;
    line-height: 1.65;
}

.card.info p:last-of-type {
    margin-bottom: 0;
}


/* =========================================================
   NOTICE
   ========================================================= */

.notice {
    margin-top: 22px;
    padding: 17px 18px;

    color: #5f4b00;
    background: #fffbeb;

    border: 1px solid #fde68a;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.6;
}

.notice strong {
    color: #713f12;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    padding: 28px 24px 36px;

    color: #6b7280;
    background: #ffffff;

    border-top: 1px solid #e5e7eb;

    font-size: 13px;
    text-align: center;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 700px) {

    .header-inner {
        padding: 18px 20px;
    }

    main {
        padding:
            32px 20px
            48px;
    }

    .intro h1 {
        font-size: 31px;
    }

    .card {
        padding: 23px;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .us-calculator {
        width: 100%;
        margin-top: 0;
    }

    .calculator-card {
        padding: 21px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 560px) {

    body {
        font-size: 15px;
    }


    /* -----------------------------------------------------
       HEADER
       ----------------------------------------------------- */

    .header-inner {
        display: block;

        padding: 17px 18px;
    }

    .logo {
        display: inline-block;

        font-size: 22px;
    }

    .tagline {
        margin-top: 3px;

        font-size: 12px;
        text-align: left;
    }


    /* -----------------------------------------------------
       MAIN
       ----------------------------------------------------- */

    main {
        padding:
            26px 14px
            40px;
    }


    /* -----------------------------------------------------
       INTRO
       ----------------------------------------------------- */

    .intro {
        margin-bottom: 22px;
    }

    .intro h1 {
        font-size: 28px;

        letter-spacing: -0.5px;
    }

    .intro p {
        font-size: 15px;
    }


    /* -----------------------------------------------------
       CARDS
       ----------------------------------------------------- */

    .card {
        margin-bottom: 18px;
        padding: 20px 17px;

        border-radius: 10px;
    }

    .calculator-grid {
        gap: 14px;
    }

    .calculator-card {
        padding: 19px 17px;

        border-radius: 10px;
    }

    .calculator-title {
        font-size: 19px;
    }

    .calculator-description {
        font-size: 14px;
    }


    /* -----------------------------------------------------
       TITLES
       ----------------------------------------------------- */

    .section-title {
        margin-bottom: 18px;

        font-size: 19px;
    }


    /* -----------------------------------------------------
       FORM GRID
       ----------------------------------------------------- */

    .settings {
        grid-template-columns: 1fr;

        gap: 16px;
    }


    /* -----------------------------------------------------
       BUTTONS
       ----------------------------------------------------- */

    .buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .buttons button {
        width: 100%;
    }


    /* -----------------------------------------------------
       RESULTS
       ----------------------------------------------------- */

    .results {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .result-box {
        min-height: auto;

        padding: 15px 16px;
    }

    .result-value {
        font-size: 21px;
    }

    .result-box.highlight {
        grid-column: auto;
    }

    .result-box.highlight .result-value {
        font-size: 26px;
    }


    /* -----------------------------------------------------
       BREAKDOWN
       ----------------------------------------------------- */

    .breakdown-row {
        gap: 12px;
    }


    /* -----------------------------------------------------
       INFO
       ----------------------------------------------------- */

    .card.info {
        padding: 20px 17px;
    }


    /* -----------------------------------------------------
       FOOTER
       ----------------------------------------------------- */

    footer {
        padding:
            24px 18px
            30px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .calculator-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .intro h1 {
        font-size: 25px;
    }

    .result-value {
        font-size: 20px;
    }

    .result-box.highlight .result-value {
        font-size: 24px;
    }
}
