/* Accessibility corrections for all screens (October 2026).
   They follow the WCAG 2.2 level AA rules that an automatic check (axe-core) found broken:
   text contrast of at least 4.5 to 1, and names that screen readers can read.
   Controls that are switched off (greyed out) are exempt from the contrast rule and are left as they are. */

/* Text for screen readers only (for example the main heading of the page) */
.taxben-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Country names under the flags in the country list: many flags look alike, and the name is
   also what screen readers read (the flag itself is decorative). css/mobile.css makes them larger. */
.taxben-form .step-2 .country-list > div {
    width: 68px;
    margin-bottom: 8px;
}

.taxben-form .step-2 .country-list label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.taxben-country-name {
    display: block;
    flex-basis: 100%;
    margin-top: 2px;
    font-size: 10px;
    font-weight: normal;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}

/* Larger boxes and round buttons, easier to hit with the mouse (13 pixels before) */
.taxben-form input[type=radio],
.taxben-form input[type=checkbox] {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* ---- Contrast ---- */

/* "Run": white on green was 3.1 to 1; this green gives 6.2 to 1 (5.0 to 1 when the mouse is over it) */
.wizard-path-step.last {
    background-color: #1A6E49;
}

.wizard-path-step.last.active {
    color: #1A6E49;
}

.taxben-form input[type=button].run,
.taxben-result input[type=button].run {
    background-color: #1A6E49;
}

/* Selected choices (output type, labour market tabs): white on #007fff was 3.8 to 1; now 5.8 to 1 */
.taxb-output-type-item--selected,
.labourMarket-tab--selected {
    background-color: #0062CC !important;
}

/* Slider handles: light text on #0095d9 was 3.1 to 1; now 4.9 to 1 or more */
.ui-slider .ui-slider-handle.ui-state-default {
    background: #006FB3;
}

.ui-slider .ui-slider-handle.ui-state-active,
.ui-slider .ui-slider-handle.ui-state-hover,
.ui-slider .ui-slider-handle.ui-state-focus {
    background: #005F8F;
}

/* Indicator tiles on the first page. Tiles not selected were made transparent, so their white
   text fell to 1.5 to 1 on a pale background. They keep the same pale look, now with dark text. */
.taxb-intro-item {
    opacity: 1;
}

.taxb-intro-item:not(.taxb-intro-item--selected) {
    background-image: linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62));
    color: #1A1A1A !important;
}

.taxb-intro-item:not(.taxb-intro-item--selected):hover {
    opacity: 1;
    background-image: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45));
}

/* Net replacement rates selected: white on light blue was 2.4 to 1 */
.taxb-intro-item--selected[data-taxben-value="nrr"] {
    color: #0B1E2D;
}

/* The "-" and "+" buttons under the sliders exist on narrow screens only (css/mobile.css) */
.taxben-stepper {
    display: none;
}

/* ---- Keyboard focus ----
   Shown only when the keyboard is used (not after a mouse click): a white ring inside a dark one,
   visible both on the blue step bar and on white. */
.wizard-path-step:focus-visible,
.taxb-intro-item:focus-visible,
.taxb-output-type-item:focus-visible,
.labourMarket-tab:focus-visible,
.info-bullet:focus-visible,
.ui-slider-handle:focus-visible,
.taxben-stepper-button:focus-visible,
.taxben-form input:focus-visible,
.taxben-form select:focus-visible,
.taxben-result input:focus-visible,
.taxben-result a:focus-visible {
    outline: 2px solid #ffffff;
    box-shadow: 0 0 0 4px #0B1E2D;
}

/* The output type choices are now div elements (a label cannot have the role "radio");
   they keep the bold text that labels have in this page. */
.taxb-output-type-item {
    font-weight: bold;
}

/* Waiting message with the countdown (js/countdown.js) */
.taxben-chart .wait {
    text-align: center;
}

.taxben-countdown-small {
    margin-top: 6px;
    font-size: 0.6em;
}

/* ---- Data tables under the results (js/data-table.js) ---- */
#taxben-data-table {
    width: 750px;
    clear: both;
    margin: 6px 0 8px 0;
}

.taxben-result input[type=button].taxben-table-toggle {
    display: inline-block;
    width: auto;
    padding: 4px 12px;
    border: 1px solid #006FB3;
    background-color: #fff;
    color: #006FB3;
}

.taxben-table-scroll {
    max-height: 420px;
    overflow: auto;
    margin-top: 8px;
    border: 1px solid #c9d6de;
}

.taxben-table {
    border-collapse: collapse;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #0B1E2D;
}

.taxben-table caption {
    text-align: left;
    font-weight: bold;
    padding: 6px 8px;
}

.taxben-table th,
.taxben-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e3e9ee;
    text-align: right;
    white-space: nowrap;
}

.taxben-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    min-width: 70px;
    background-color: #DDE9EF;
    white-space: normal;
    vertical-align: bottom;
}

.taxben-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #fff;
    text-align: left;
}

.taxben-table thead th:first-child {
    left: 0;
    z-index: 3;
}

/* Box for typing a slider value (js/accessibility.js) */
.taxben-value-editor {
    position: absolute;
    z-index: 100;
    width: 80px;
    padding: 4px 6px;
    font-size: 14px;
    border: 2px solid #006FB3;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* The step "Countries and years" (the 3rd) scrolls when its content is taller than the calculator,
   instead of being cut off at the bottom: with the country names, the notes under the list of
   years need a little more room. The other steps are unchanged. */
.wizard-steps-tray,
.wizard-step {
    height: 100%;
}

.wizard-steps-tray > .wizard-step:nth-child(3) .wizard-step-content {
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ---- Countries and years on wide screens: the whole step fits in the calculator ----
   With the country names under the flags the step became taller than the calculator, so the years
   were cut off at the bottom. Slightly smaller flags (36 pixels instead of 45), shorter names on one
   line (js/countries-years-wizard.js), less empty space between the parts, and the notes on Israel
   and Cyprus open with a click. */
@media (min-width: 816px) {
    .taxben-form .step-2 .country-list > div {
        margin-bottom: 4px;
    }

    .taxben-form .step-2 .country-list > div img {
        max-width: 36px;
        max-height: 36px;
    }

    .taxben-form .step-2 h3 {
        margin-top: 6px !important;
        margin-bottom: 6px !important;
    }

    /* "Select All", "Select OECD"... on the same line as the title "Countries:" (or "Years:"),
       before the lists, so that they are seen before one starts to tick boxes one by one. When the
       line is too short, they go to the next line, still above the list. */
    .taxben-form .step-2 .taxben-block {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 12px;
    }

    .taxben-form .step-2 .taxben-block > * {
        flex: 0 0 100%;
    }

    .taxben-form .step-2 .taxben-block > h3 {
        flex: 1 1 auto;
    }

    .taxben-form .step-2 .taxben-block > .list-commands {
        flex: 0 0 auto;
        margin: 0 4px 0 0;
    }

    .taxben-form .step-2 .taxben-block > .list-commands a {
        display: inline-block;
        margin: 0 0 0 12px;
        font-size: 13px;
        line-height: 24px; /* targets at least 24 pixels high */
    }

    .taxben-form .step-2 .list-commands {
        margin-top: 0;
    }

    .taxben-form .step-2 .year-list > div {
        margin-bottom: 2px;
    }
}

.taxben-form .step-2 .taxben-additional-countries {
    margin: 8px 0 6px 0;
}

/* Countries and years in two separate panels */
.taxben-form .step-2 .taxben-block {
    margin-top: 8px;
    padding: 0 6px 4px 6px;
    border: 1px solid #C9D6DE;
    border-radius: 6px;
    background-color: #F5F8FA;
}

.taxben-form .step-2 .taxben-block-years {
    margin-top: 10px;
}

/* Non-OECD countries and the buttons Select All... on the same row when there is room */
.taxben-form .step-2 .taxben-additional-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 12px;
}

.taxben-form .step-2 .country-list-commands {
    margin: 4px 0;
}

.taxben-country-notes {
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px;
    font-size: 11px;
    line-height: 24px; /* each note is a target at least 24 pixels high */
    color: #333;
}

.taxben-country-notes details[open] {
    flex-basis: 100%; /* an open note takes the whole width */
    line-height: 1.5;
}

.taxben-country-notes details[open] summary {
    line-height: 24px;
}

.taxben-country-notes summary {
    cursor: pointer;
    color: #006FB3;
}

.taxben-country-notes summary::-webkit-details-marker {
    display: none;
}

.taxben-country-notes summary {
    list-style: none;
}

.taxben-country-notes p {
    margin: 2px 0 6px 10px;
}



.taxben-form .step-2 #methodologyWarningPlaceholder {
    margin: 5px 0 !important;
}

/* A "?" after the label of a checkbox stays on the same line as the last word of the label
   (js/info.js). The script of the page shows these labels as blocks (display: inline-block); as
   plain text they flow like the other long labels of the page. A hidden label stays hidden. */
.taxben-keep-help > label:not([style*="none"]) {
    display: inline !important;
}

.taxben-keep-help-glue {
    white-space: nowrap;
}

/* ---- Benefits ----
   The list of benefits uses the empty space on the left, so that every name and its "?" stay on
   one line. Each benefit, with its options on the right, is a band; one band in two has a very
   light background (js/accessibility.js marks these bands, because some benefits are hidden for
   some calculations). */
.wizard-step-content {
    text-align: left; /* was "justify", which spread the words of the titles */
}

@media (min-width: 816px) {
    .taxben-form .step-5 table.struct td:first-child {
        width: 52%;
        padding-left: 6px;
    }

    .taxben-form .step-5 table.struct td:nth-child(2) {
        padding-left: 8px;
    }

    /* No line in the middle of the title row */
    .taxben-form .step-5 table.struct tr:first-child > td {
        border-right: none;
    }

    .taxben-form .step-5 table.struct tr.taxben-band-alt > td {
        background-color: #F2F6F9;
    }

    .taxben-form .step-5 table.struct tr.taxben-band-alt > td:first-child {
        border-radius: 4px 0 0 4px;
    }

    .taxben-form .step-5 table.struct tr.taxben-band-alt > td:last-child {
        border-radius: 0 4px 4px 0;
    }

    .taxben-form .step-5 table.struct td:first-child input[type=checkbox] {
        margin-left: 0;
    }

    .taxben-form .step-5 table.struct td {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .taxben-form .step-5 table.struct td.title {
        padding-bottom: 7px;
    }

    /* Benefits without options on the right need less room */
    .taxben-form .step-5 table.struct tr:has(> td:nth-child(2):empty) > td {
        padding-top: 3px;
        padding-bottom: 3px;
    }


    /* Space between the parts of the options of a benefit */
    .taxben-form .step-5 .benefit-options h3,
    .taxben-form .step-5 .when-jobbenefit h3 {
        margin-top: 12px !important;
        margin-bottom: 7px !important;
    }

    /* The first title of the options is level with the name of the benefit */
    .taxben-form .step-5 .benefit-options > div:first-child > h3:first-child,
    .taxben-form .step-5 .when-jobbenefit > h3:first-child {
        margin-top: 0 !important;
    }

    .taxben-form .step-5 .benefit-options ul {
        margin-bottom: 8px;
    }

    .taxben-form .step-5 .benefit-options div[data-taxben-value=Amount] > div {
        margin-bottom: 4px;
    }

    /* The sliders fit in their column, also with the value at the far right */
    .taxben-form .step-5 #housingCosts,
    .taxben-form .step-5 #monthsOfNewJob,
    .taxben-form .step-5 #monthsOutOfWork2,
    .taxben-form .step-5 #benefit-unemployment-earnings,
    .taxben-form .step-5 #benefit-unemployment-socialContributionSlider,
    .taxben-form .step-5 #benefit-unemployment-percentOfAWSlider {
        width: calc(100% - 36px);
        max-width: 350px;
        margin-top: 4px;
        margin-bottom: 4px;
    }

    /* "(22 years)" under the slider, clear of the slider handle */
    .taxben-form .step-5 .m2y {
        margin-top: 10px !important;
    }

    /* The warning on the age of the adult takes no room while it is not shown */
    .taxben-form .step-5 .alert-age {
        height: 0;
        overflow: visible;
    }

    /* "Months in the new job" and "Months out of work" side by side */
    .taxben-form .step-5 #newJobBenefitWrapper .when-jobbenefit {
        display: inline-block;
        width: calc(50% - 6px);
        vertical-align: top;
    }

    .taxben-form .step-5 #newJobBenefitWrapper td > br {
        display: none;
    }
}

/* Labour market: more room above the block of the second adult (the partner), which was too close
   to the sliders of the first adult (it had margin-top: -8px). */
@media (min-width: 816px) {
    .taxben-form #adult2PartTitle {
        margin-top: 10px !important;
    }
}

/* ---- Wide screens: the calculator in the middle of the page ----
   In the frame of the oecd.org page (wider than the calculator) and on its own page, the calculator
   was at the left edge. */
@media (min-width: 900px) {
    #root {
        width: 800px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Link "Open the calculator in full screen": only inside a frame, and only on narrow screens
   (js/mobile.js adds it; css/mobile.css shows it) */
#taxben-fullscreen-bar {
    display: none;
}

/* A phone showing the calculator in a frame wider than its screen (js/mobile.js): the calculator
   at the left edge, where the screen shows it, and a large link to open it in full screen */
.taxben-frame-too-wide #root {
    margin-left: 0;
}

.taxben-frame-too-wide #taxben-fullscreen-bar {
    display: block;
    box-sizing: border-box;
    width: 340px;
    margin: 0 0 10px 0;
    padding: 14px 12px;
    background-color: #156df9;
    border-radius: 6px;
    text-align: center;
}

.taxben-frame-too-wide #taxben-fullscreen-bar a {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    line-height: 1.3;
}
