/* =============================================================================
 * accessibility.css — site-wide WCAG 2.2 AA styling
 * -----------------------------------------------------------------------------
 * The only stylesheet where accessibility overrides go: the existing
 * stylesheets are not edited. Loaded LAST by both layouts
 * (common/common_css.html and base.html), after the theme files.
 * Nothing in here sets a colour on normal / :hover / .active states — colour
 * overrides loaded later than the theme files beat the themes' own hover and
 * active rules (an earlier contrast-override attempt broke 73 of them), so
 * text contrast must be fixed in the theme stylesheets themselves.
 *
 *   1. Visible keyboard focus       (2.4.7 Focus Visible, 1.4.11 Non-text Contrast)
 *   2. Skip link                    (2.4.1 Bypass Blocks)
 *   3. Custom checkboxes / radios   (2.4.7 — the real input is hidden)
 *  3c. Unreachable checkboxes/radios (2.1.1 — input was display: none)
 *   4. Popup focus target           (no ring on the box focused on open)
 *   5. Reduced motion               (2.3.3, user preference)
 *   6. Text spacing / reflow        (1.4.10, 1.4.12)
 *   7. Off-canvas / hamburger menu  (1.4.10, 2.1.1, 2.4.3)
 *   8. Placeholder contrast         (1.4.3)
 *   9. Reflow of wide panels        (1.4.10 chat, psychologist onboarding)
 *  10. Tooltips                     (1.4.13 hoverable & dismissable)
 *  11. Visually disabled controls   (4.1.2 — must not look enabled)
 * ========================================================================== */

/* -----------------------------------------------------------------------------
 * 1. Visible keyboard focus
 * The site has ~175 "outline: none / 0" rules, 47 of them !important and up to
 * one ID + two classes in specificity (#psy_listing .psy_fliter:focus-visible).
 * Each :not(#lc-a11y) adds one ID of specificity without matching anything
 * extra (no element has that id), so this rule — (3,1,0) + !important —
 * beats all of them. :focus-visible only shows the ring for keyboard focus,
 * so mouse clicks look exactly as before.
 * [tabindex="-1"] is excluded: those are containers that receive focus from
 * script (skip-link target, popup box) and Bootstrap hides their ring too.
 *
 * ----- Accessibility: DOUBLE focus indicator (retest feedback on issue #4) -----
 * A single blue ring reaches 3:1 against the white page but not against the
 * dark-green sidebar / dark buttons, so the ring "disappeared" in the user
 * navigation menu. The ring is now two-tone, the technique the auditor asked
 * for: a white inner ring drawn with box-shadow (>= 3:1 on every dark surface
 * the site uses) and the blue outline outside it (>= 3:1 on every light one).
 * Whichever of the two has contrast on the current background is the one the
 * user sees, so the indicator works on ALL backgrounds.
 * box-shadow is used for the inner ring (not a border) so nothing reflows.
 * -------------------------------------------------------------------------- */
:focus-visible:not([tabindex="-1"]):not(#lc-a11y):not(#lc-a11y):not(#lc-a11y) {
  outline: 3px solid #015fcc !important;   /* same blue the skip link uses */
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

/* The same double ring on the custom checkbox / radio box (see 3. below) and
 * on elements whose own box-shadow must be kept (none override this one). */
.check_cont input:focus-visible ~ .checkmark,
.radio_cont input:focus-visible ~ .checkmark,
.rad_cont input:focus-visible ~ .checkmark,
.cusRad input:focus-visible ~ .checkmark,
.cusChk input:focus-visible ~ .checkmark {
  box-shadow: 0 0 0 2px #ffffff !important;
}

/* -----------------------------------------------------------------------------
 * 1b. Focus rings that were being clipped away (2.4.7)
 * Bootstrap's grid_custom.min.css contains ".accordion>.card{overflow:hidden}".
 * An accordion header that fills its card edge to edge — the caregiver
 * profile's "Profilato / Affidabile / Professionale" levels
 * (.btn-header-link, solace/caregiverpro/profile/profile_badge_level.html) —
 * therefore had its focus ring drawn OUTSIDE the card and clipped to nothing
 * by that overflow:hidden. The header is reachable with Tab and always was,
 * but nothing appeared on screen, which is indistinguishable from "it cannot
 * be focused" and is exactly what 2.4.7 is about. The theme also sets
 * "outline: none; box-shadow: none" on it, which rule 1 already overrides.
 *
 * Drawing the ring INSIDE the element (negative outline-offset, and an inset
 * box-shadow for the second tone) keeps it within the clipping box, so it
 * survives. The inner tone is white for the collapsed state (white card) and
 * is still visible against the expanded state's #FFE472 yellow, because the
 * blue outline sits right next to it.
 * -------------------------------------------------------------------------- */
.accordion > .card :focus-visible:not([tabindex="-1"]):not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
.btn-header-link:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y) {
  outline: 3px solid #015fcc !important;
  outline-offset: -3px !important;              /* inside, so it is not clipped */
  box-shadow: inset 0 0 0 5px #ffffff !important;
}

/* The caregiver "Aggiungi servizio" wizard (#add_serviceModal in
 * solace/caregiverpro/profile/caregiver_update.html) scrolls each step inside
 * ".add_sereMod .step-body { overflow-y: auto }". A non-visible overflow-y
 * also clips horizontally, and the fields run edge to edge in that box, so the
 * ring (3px outline + 2px offset) was cut off on the left and right of e.g.
 * "Anni di esperienza". Padding the box by more than the ring's 5px gives the
 * ring room inside it. No negative margin: the parent .pop_cont clips too and
 * has no padding of its own, so the ring would just be cut off there. */
.add_sereMod .step-body {
  padding-left: 6px;
  padding-right: 6px;
}

/* Same clipping in the popups: ".modal.modPop .modal_card { overflow-y: auto }"
 * (style.css) ends right at the bottom of the last button row, so the ring on
 * e.g. "Chiudi" in the "Il tuo annuncio è stato pubblicato!" popup
 * (#job_modal, solace/employee/common_popup/job_success.html) lost its bottom
 * edge. Padding the button row by more than the ring's 5px keeps it inside. */
.modal.modPop .modal_card .btn_sec {
  padding-bottom: 6px;
}

/* -----------------------------------------------------------------------------
 * 1c. No ring on form fields after a mouse click
 * Browsers treat a mouse click on a <select> or a text box as :focus-visible,
 * so rule 1 drew the ring on every input / select / textarea the user clicked,
 * site-wide. style.css already tries to hide it (body.no-focus-outline
 * input:focus) but loses to rule 1's specificity. Also covered, for the
 * non-field parts of these widgets:
 *   - .multi_wrp    "Ambiti di intervento" (psychologist/employee_psy_home.html)
 *   - .tbSrchInner  course / matched-job search box (courses/*, job_post_matched)
 * common_header.html and _header.html (i.e. both layouts) put
 * .no-focus-outline on <body> on mousedown and remove it on Tab, so the ring
 * is hidden only while the pointer is in use and returns as soon as the user
 * tabs. The extra class and elements give it higher specificity than rules 1
 * and 1b.
 * -------------------------------------------------------------------------- */
body.no-focus-outline input:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
body.no-focus-outline select:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
body.no-focus-outline textarea:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
body.no-focus-outline [contenteditable]:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
body.no-focus-outline .multi_wrp :focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
body.no-focus-outline .tbSrchInner :focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y) {
  outline: none !important;
  box-shadow: none !important;
}

/* -----------------------------------------------------------------------------
 * 1d. Chat search: the ring goes around the whole bar, not the text box
 * The chat pages (chat/employee_chat.html, psy_chat.html, caregiverpro_chat.html)
 * draw the search as one bordered bar (.chat_srch) holding #user_search and
 * its button. A ring on the borderless text box alone sat inside that bar, so
 * the ring is drawn on .chat_srch instead while the text box has focus. As
 * with 1c it is shown for keyboard use only (no .no-focus-outline on <body>).
 * The search button keeps its own ring from rule 1.
 * -------------------------------------------------------------------------- */
#user_search:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y) {
  outline: none !important;
  box-shadow: none !important;
}

body:not(.no-focus-outline) .chat_srch:has(#user_search:focus) {
  outline: 3px solid #015fcc !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

/* -----------------------------------------------------------------------------
 * 1e. Chat message box: the ring goes around the whole box, not the textarea
 * Same idea as 1d for the message field at the bottom of the chat pages: the
 * bordered box is .chat-input-area and the borderless textarea inside it
 * (.chat-input) never draws a ring of its own, whatever the input method.
 * The ring on .chat-input-area is shown for keyboard use only: a mouse click
 * puts .no-focus-outline on <body> (common_header.html), so it stays hidden.
 * -------------------------------------------------------------------------- */
.chat-input:focus:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
.chat-input:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y) {
  outline: none !important;
  box-shadow: none !important;
}

body:not(.no-focus-outline) .chat-input-area:has(.chat-input:focus) {
  outline: 3px solid #015fcc !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

/* -----------------------------------------------------------------------------
 * 1f. No focus at all on the "Presentazione assistita da IA" tag
 * .ai_btnWrp > button.ai_BtnCG (solace/employee/caregiverpro_detail.html) is a
 * label that does nothing, so the template keeps it out of the Tab order
 * (tabindex="-1"). A mouse click still focuses a <button>, and Bootstrap's
 * button:focus / the theme's :focus rules would then draw a ring; this takes
 * every focus style off the button and its wrapper, whatever the input method.
 * -------------------------------------------------------------------------- */
.ai_btnWrp:focus:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
.ai_btnWrp:focus-within:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
.ai_btnWrp .ai_BtnCG:focus:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y),
.ai_btnWrp .ai_BtnCG:focus-visible:not(#lc-a11y):not(#lc-a11y):not(#lc-a11y) {
  outline: none !important;
  box-shadow: none !important;
}

/* -----------------------------------------------------------------------------
 * 2. Skip link — first element in <body> (#skiptocontent > a.lc-skip-link).
 * style.css already styles #skiptocontent on employee / anonymous pages; these
 * rules give the caregiver (style_caregiver.css) and psychologist
 * (style_psy.css) pages the same green tab. Hidden off-screen by Bootstrap's
 * .sr-only until it gets focus.
 *
 * ----- Accessibility: visible at 200% / 400% zoom (retest feedback) -----
 * style.css pins the focused link with position:absolute; top:0, i.e. to the
 * top of the DOCUMENT. At 200%/400% zoom the page is usually already scrolled
 * when the link is tabbed to, so it was placed above the viewport and the
 * auditor saw focus land on something invisible. position:fixed pins it to the
 * VIEWPORT instead, so it is on screen at every zoom level and scroll offset.
 * -------------------------------------------------------------------------- */
#skiptocontent a.lc-skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  max-width: 100vw;             /* never forces sideways scrolling at 400% */
  z-index: 100000;              /* above headers and open popups */
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px 12px;
  clip: auto;
  overflow: visible;
  white-space: normal;          /* wraps instead of overflowing at 400% zoom */
  color: #fff;
  background: #3f5c17;          /* darkened brand green: 7.6:1 with white */
  border-bottom-right-radius: 8px;
  text-decoration: underline;
  font-weight: 600;
}

/* -----------------------------------------------------------------------------
 * 3. Custom checkboxes / radios — markup is
 *    <label class="check_cont"><input type="checkbox"> ... <span class="checkmark">
 * or the same with label.cusChk (e.g. the job post "ATTIVITÀ" list, .actCatg_l)
 * or label.rad_cont (e.g. the job post address choice, .addr_radSec)
 * or label.cusRad (e.g. the "Trova l'esperto" question choice, .fexpRow).
 * style.css hides the real input (opacity 0, 0×0), so the ring from rule 1 is
 * invisible; draw it on the visible .checkmark box instead. A mouse click on a
 * checkbox or radio is not :focus-visible, so the ring shows for keyboard use
 * only.
 * -------------------------------------------------------------------------- */
.check_cont input:focus-visible ~ .checkmark,
.radio_cont input:focus-visible ~ .checkmark,
.rad_cont input:focus-visible ~ .checkmark,
.cusRad input:focus-visible ~ .checkmark,
.cusChk input:focus-visible ~ .checkmark {
  outline: 3px solid #015fcc !important;
  outline-offset: 2px !important;
}

/* -----------------------------------------------------------------------------
 * 3b. On/off switches — markup is
 *    <div class="switchWrpShape"><input type="checkbox"> <label class="slider">
 * (the psychologist's weekly days, psychologist/psy_availability.html).
 * Bootstrap's .custom-control-input hides the real checkbox (opacity 0,
 * z-index -1), so draw the ring on the visible .slider track instead; its
 * rounded corners make the ring follow the pill shape. Keyboard use only, as
 * in rule 3.
 * -------------------------------------------------------------------------- */
.switchWrpShape input:focus-visible + .slider,
.switch input:focus-visible + .slider {
  outline: 3px solid #015fcc !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

/* -----------------------------------------------------------------------------
 * 3c. Checkboxes / radios that could not be reached with Tab at all (2.1.1)
 * These widgets hide the real input with "display: none" or
 * "visibility: hidden", which also removes it from the tab order, so the
 * control could only be used with the mouse:
 *   - .checkbox / .radio          project.css (account/email.html)
 *   - .pill                       caregiver "Esperienza" pills (service_exp.html)
 *   - .radio-card                 job search pause / course test answers
 *                                 (proposals_list.html, caregiver_update.html)
 *   - .star-rating.rwRate         review stars (common_header.html, course_detail.html)
 *   - .star_ratCont .rating       job close / caregiver review stars
 *   - .custom-checkbox-pill       job post day / time slot pills (edit_employee_job.html)
 *   - .filterBtn                  filter toggle buttons
 * They are hidden visually instead (the same "opacity 0" technique the rest
 * of the site uses), which keeps them focusable and announced by screen
 * readers. position: absolute with no offsets leaves the input at its normal
 * spot, so the page scrolls to the right place on focus, but takes it out of
 * the flow, so the layout is unchanged. The selectors repeat the originals so
 * that, loaded later, they win over them.
 * -------------------------------------------------------------------------- */
.checkbox > label > input,
.radio > label > input,
.userExpWrp_multiStep .pill input,
.multiPillsWrp .pill input,
.jobSrchPause_optWrp .radio-card input[type="radio"],
.star-rating.rwRate input,
.star_ratCont .rating > input,
.apptAvailSec .custom-checkbox-pill,
.filterBtn input {
  display: inline-block;
  visibility: visible;
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;    /* clicks still go to the visible label */
}

/* The ring for those, and for the remaining opacity-0 widgets that had none
 * (.custom-checkbox, Bootstrap .custom-control, the NPS score whose own ring
 * was a 35%-opacity green below 3:1), drawn on the visible part. */
.checkbox > label > input:focus-visible + span,
.radio > label > input:focus-visible + span,
.pill input:focus-visible + span,
.jobSrchPause_optWrp .radio-card input[type="radio"]:focus-visible + label,
.star-rating.rwRate input:focus-visible + label,
.star_ratCont .rating > input:focus-visible + label,
.apptAvailSec .custom-checkbox-pill:focus-visible + .checkbox-label,
.filterBtn input:focus-visible + span,
.custom-checkbox input:focus-visible ~ .checkmark,
.custom-control-input:focus-visible ~ .custom-control-label::before,
.nps-option input:focus-visible + .nps-number {
  outline: 3px solid #015fcc !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

/* -----------------------------------------------------------------------------
 * 4. Popups — accessibility.js focuses .modal-content (tabindex="-1") when a
 * popup opens so screen readers start at its title. No ring on that box.
 * !important: style.css has a global ":focus-visible { outline ... !important }"
 * that otherwise draws the ring when the popup opens on page load.
 * -------------------------------------------------------------------------- */
.modal [tabindex="-1"]:focus,
.modal [tabindex="-1"]:focus-visible {
  outline: none !important;
}

/* -----------------------------------------------------------------------------
 * 5. Reduced motion — users who ask the OS for less motion get no animated
 * transitions / carousels sliding. 0.01ms (not 0) so transitionend /
 * animationend still fire and the JS waiting on them keeps working.
 * Slick / Owl autoplay itself is paused in accessibility.js.
 * -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -----------------------------------------------------------------------------
 * 6. Reflow — long words (e-mail addresses, codice fiscale, URLs) wrap instead
 * of forcing sideways scrolling at 320px / 400% zoom.
 * -------------------------------------------------------------------------- */
p, li, td, th, label, .sepop_txt, .modal-content {
  overflow-wrap: break-word;
}

/* -----------------------------------------------------------------------------
 * 7. Off-canvas ("hamburger") menu — #MobMenuModal
 * Retest findings #21 / #108 / #109:
 *   - at 1280px + 400% zoom the menu items ran past the panel and overlapped
 *     the page behind it (1.4.10),
 *   - the panel had no visible close control, so keyboard users could not
 *     dismiss it (2.1.1) and could tab straight out of it onto the page
 *     underneath while it stayed open on top (2.4.3).
 * The close button is in the templates; these rules make the panel a proper
 * scrolling column so nothing overflows it at any zoom level, and place the
 * button in the panel's top-right corner.
 * -------------------------------------------------------------------------- */
.mobMenuModal .modInnerW .modal-content {
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  max-height: 100vh;
  overflow: hidden;             /* the scrolling happens in .mobMWrp below */
}

/* The link list is the part that scrolls; min-height:0 lets a flex child
 * actually shrink below its content height (without it the list grows and
 * pushes items outside the panel, which is what the auditor saw at 400%). */
.mobMenuModal .mobMWrp,
.mobMenuModal .menuProf + .mobMWrp {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.mobMenuModal .menuProf {
  flex: 0 0 auto;
}

/* Close ("X") control added to the panel in the sidebar templates. */
.mobMenuModal .lc-menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #033f28;
  line-height: 1;
}

.mobMenuModal .lc-menu-close svg {
  width: 100%;
  height: 100%;
}

/* Keep the first menu entry clear of the close button. */
.mobMenuModal .modal-content > .menuProf,
.mobMenuModal .modal-content > .mobMWrp {
  padding-top: 40px;
}

/* -----------------------------------------------------------------------------
 * 8. Placeholder contrast (1.4.3) — issue #49.
 * The browser default (and the themes' #a9a9a9-ish greys) sit around 2.5:1 on
 * the white / very light field backgrounds this site uses. #595959 is 7:1 on
 * white and 4.6:1 on the lightest field fill (#f2f9e9), so it passes
 * everywhere while still reading as placeholder text rather than a value.
 * Placeholders are not a hover / active state, so overriding them here does
 * not hit the problem described at the top of this file.
 * -------------------------------------------------------------------------- */
input::placeholder,
textarea::placeholder {
  color: #595959;
  opacity: 1;                   /* Firefox dims placeholders by default */
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder { color: #595959; }

input::-moz-placeholder,
textarea::-moz-placeholder { color: #595959; opacity: 1; }

input:-ms-input-placeholder,
textarea:-ms-input-placeholder { color: #595959; }

/* -----------------------------------------------------------------------------
 * 9. Reflow of wide panels (1.4.10) — issues #44, #98, #102.
 * At 1280px + 200% / 400% zoom the CSS viewport is 640px / 320px wide. Three
 * panels were built at a fixed pixel width and so either scrolled the whole
 * page sideways or covered a control the user needed:
 *   #44  the job filters' "X" ended up under the chat widget,
 *   #98  the chat conversation could not be seen at all,
 *   #102 the psychologist onboarding scrolled horizontally.
 * Only the max-width-320/640 cases are touched, so nothing changes on a normal
 * desktop or on a phone-sized layout that already works.
 * -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Nothing may force the page sideways at 200% / 400% zoom. */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Chat: the conversation column is the important one, let it take the width
     and scroll vertically instead of being pushed off screen. */
  .chatWrapper, .lc_chatWrp, .chat_right, .chat_left, .chatBoxWrp {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .chat_right, .chatBoxWrp {
    width: 100% !important;
  }

  /* Psychologist onboarding (#102: at 1280px + 200% zoom, and at 320px, the
     page did not reflow and scrolled sideways) and the job filter panel. */
  .psy_onboarding_wrp, .onbrdWrp, .stepperWrp,
  .multisteps-form, .multisteps-form__panel, .multisteps-form__form,
  .stepCardPsy, .stepFormWrp, .formPanelInner,
  .fliterWrp, .psy_fliterWrp, .mfWrp {
    max-width: 100% !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* The step dots are laid out in a fixed row that overflowed the viewport. */
  .multisteps-form__progress {
    flex-wrap: wrap;
    max-width: 100%;
  }

  /* Two-column form rows become one column rather than overflowing. */
  .stepFormWrp, .twin-fld, .tw_fld {
    flex-direction: column;
  }

  /* A floating close control must stay inside the viewport and above the
     chat launcher (#44). */
  .fliterWrp .cls, .fliterWrp .close, .mfWrp .cls {
    z-index: 10001;
  }
}

/* -----------------------------------------------------------------------------
 * 10. Tooltips (1.4.13 Content on Hover or Focus) — issues #35, #36, #37.
 * The tooltips vanished as soon as the pointer left the trigger, so the
 * pointer could not be moved onto the tooltip itself to read or scroll it.
 * Keeping them shown while the pointer (or focus) is anywhere inside the
 * trigger-plus-tooltip wrapper makes them "hoverable"; accessibility.js adds
 * the Esc handler that makes them "dismissable".
 * -------------------------------------------------------------------------- */
.lc-tooltip-wrap:hover > .lc-tooltip,
.lc-tooltip-wrap:focus-within > .lc-tooltip,
.lc-tooltip-wrap > .lc-tooltip:hover,
.lc-tooltip[data-lc-tooltip-open="true"] {
  display: block;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* The gap between trigger and bubble must not break the hover, or the tooltip
 * closes while the pointer crosses it. */
.lc-tooltip-wrap {
  position: relative;
  display: inline-block;
}

/* -----------------------------------------------------------------------------
 * 11. Controls that only LOOK disabled (4.1.2) — issues #30, #93.
 * Keyboard users could tab to, and activate, buttons that were greyed out.
 * Templates now set `disabled` / `aria-disabled="true"`; this makes the two
 * states look the same as the class-only styling they replace.
 * -------------------------------------------------------------------------- */
[aria-disabled="true"] {
  cursor: not-allowed;
}

/* -----------------------------------------------------------------------------
 * 10b. Calendar column headers (1.3.1) — issue #113.
 * The weekday cells of the booking calendar were <td> and are now
 * <th scope="col"> (js/calendar/jquery.simple-calendar.js), which is what ties
 * each day to its weekday for a screen reader. style_psy.css styles them as
 * ".calendar thead td", selecting them by tag, so the same declarations are
 * repeated here for <th>. <th> is also bold and centred by default, which the
 * rule already was — font-weight/text-align are restated so the two cannot
 * drift apart. (The theme stylesheets themselves are never edited.)
 * -------------------------------------------------------------------------- */
.calendar thead th {
  padding: 5px 0;
  color: #121212;
  text-align: center;
  font-family: var(--font-family-inter);
  font-size: 16px;
  font-weight: 800;
  line-height: 24px;
  text-transform: uppercase;
}

/* -----------------------------------------------------------------------------
 * 11a. Psychologist onboarding stepper — text contrast (1.4.3) and dot
 * contrast (1.4.11), issue #101: "Le etichette dei campi di input e dello
 * stepper non raggiungono il rapporto minimo di contrasto con lo sfondo".
 * style_psy.css colours the step labels rgba(108,117,125,.7) — about #9ba0a4
 * once flattened onto white, which is 2.6:1 and fails both the 4.5:1 needed
 * for the label text and the 3:1 needed for the dot and connector drawn in
 * currentColor. The active step is #007bff, 3.9:1, which also falls short for
 * text. Both are darkened to the nearest tone that passes; the hue is kept, so
 * the stepper still reads as "grey steps, blue current step".
 * These are a plain state and the current-step state, not hover states, so the
 * caution at the top of this file does not apply: the .js-active rule below
 * has the same specificity as the theme's own and is loaded after it.
 * -------------------------------------------------------------------------- */
.multisteps-form__progress-btn {
  color: #595959;                 /* was rgba(108,117,125,.7) — now 7:1 on white */
}

.multisteps-form__progress-btn.js-active {
  color: #0057b8;                 /* was #007bff — now 6.3:1 on white */
}

/* -----------------------------------------------------------------------------
 * 11b. Headings that changed level (1.3.1) — issue #19.
 * Several pages used <h1> for every heading, so the outline carried no
 * structure. The levels are corrected in the templates; where a theme rule
 * selected the heading by TAG rather than by class, the same declarations are
 * repeated here for the new tag so the pages look exactly as before.
 * (The theme stylesheets themselves are never edited — see the file header.)
 * -------------------------------------------------------------------------- */
.jbpDetSec h3 {                 /* was .jbpDetSec h1 in style.css */
  font-size: 24px;
  font-weight: 800;
  line-height: 32px;
  color: var(--Color-text-and-icons-primary);
  font-family: var(--font-family-manrope);
  margin: 0;
}

@media (max-width: 767px) {
  .jbpDetSec h3 {               /* was .jbpDetSec h1 in responsive.css */
    font-size: 20px;
    margin-bottom: 0;
    line-height: 32px;
  }
}

/* -----------------------------------------------------------------------------
 * 11c. Real <fieldset>/<legend> grouping (1.3.1) — issues #38, #105, #31.
 * Sets of checkboxes and radios are now wrapped in a fieldset so the group's
 * name is carried by the markup itself. A fieldset brings a default border,
 * padding and margin, and a legend brings its own box: these rules take all of
 * that away so the panels look exactly as they did before the wrapper existed.
 * min-width:0 is the standard fix for a fieldset refusing to shrink inside a
 * flex layout (it would otherwise break the reflow at 320px).
 * -------------------------------------------------------------------------- */
.lc-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: block;
}

.lc-legend {
  display: block;
  width: auto;
  max-width: 100%;
  padding: 0;
  margin: 0;
  float: none;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  white-space: normal;
}

/* -----------------------------------------------------------------------------
 * 11d. Controls given a button role (4.1.2) — issues #39, #41, #42, #53, #59,
 * #75, #80, #81, #89, #111.
 * Accordion headers, tabs and "do something on this page" controls were plain
 * links. They now carry role="button" / role="tab" rather than being retagged
 * as <button>, because the theme stylesheets select several of them by TAG
 * ("a.card-link", "a.tablinks"); retagging would silently drop their colour,
 * weight and icon positioning. The role is what assistive technology reads, and
 * accessibility.js adds the Space key a real button would have.
 * The pointer stays a pointer so they still feel like controls.
 * -------------------------------------------------------------------------- */
a[role="button"],
a[role="tab"],
[role="button"]:not(button):not(input) {
  cursor: pointer;
}

/* -----------------------------------------------------------------------------
 * 12. "Required fields are marked with an asterisk" legend (3.3.2 / 2.4.6).
 * Added to the registration forms and the caregiver profile (issues #8, #77).
 *
 * Shown to screen readers only, by product decision — the sentence is read out
 * before the fields but is not on screen.
 * NOTE for whoever retests this: issue #8 was raised as a VISUAL problem
 * ("Non viene specificato agli utenti, visivamente, quali campi di input sono
 * obbligatori") and the reviewer's note asked for the sentence partly for
 * users with a cognitive disability or who are neurodivergent, who get nothing
 * from a screen-reader-only text. Making this visible again is a one-line
 * change: delete this rule's declarations and use the ones kept below.
 *
 *   .lc-required-legend {
 *     margin: 0 0 16px;
 *     font-size: 0.875rem;
 *     line-height: 1.4;
 *     color: #4a4a4a;          (7.5:1 on white)
 *   }
 * -------------------------------------------------------------------------- */
.lc-required-legend {
  /* Visually hidden, still read out. Same technique as Bootstrap's .sr-only:
   * the element keeps a 1x1 box inside the layout (it is NOT display:none and
   * NOT visibility:hidden, either of which would take it out of the
   * accessibility tree as well) and is clipped to nothing. Screen readers
   * announce it before the fields; sighted users do not see it.
   * white-space:nowrap stops the clipped text from being laid out as a tall
   * column of single characters, which some engines do inside a 1px box. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Controls that navigate were <button onclick="location.href=…"> and are now
 * real links (issues #6 / #12 / #42 / #55 / #94). These two declarations keep
 * them looking exactly like the buttons they replace. */
a.reg_btn,
a.lc_gBtn,
a.inf_nBtn {
  text-decoration: none;
  text-align: center;
}

a[aria-disabled="true"],
[role="button"][aria-disabled="true"] {
  pointer-events: none;
}
