/**
 * QA fixes for Evohome sheet BUG-001–010 (2026-08-20).
 * Loaded after the theme stylesheet; keep selectors specific.
 */

/* BUG-003 side-effect: intro heading was promoted to h1 for a11y, but theme
   only styles .flexible_intro-text h2 — restore the same display typography. */
.flexible_intro-text h1 {
  font-size: 70px;
  line-height: 70px;
  font-size: clamp(30px, 6vw, 80px);
  line-height: clamp(30px, 6vw, 80px);
  font-weight: 400;
  letter-spacing: 5px;
  text-transform: uppercase;
}

.flexible_intro-text h1 strong {
  font-weight: 700;
}

.flexible_intro-text h1:not(:last-child) {
  margin-bottom: 53px;
}

@media (max-width: 960px) {
  .flexible_intro-text h1:not(:last-child) {
    margin-bottom: 30px;
  }
}

/* BUG-001: theme targets .dl_form-feedback (wrong); markup is .dl_form--feedback.
   On success fields fade to opacity .05 — overlay must cover them. */
.dl_form.success .dl_form--feedback {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

.dl_form.success .dl_form--feedback.success,
.dl_form.success .dl_form--feedback.error {
  visibility: visible;
  opacity: 1;
}

.dl_form.success .dl_form--feedback a {
  pointer-events: auto;
  color: #fff;
  text-decoration: underline;
}

/* Contact form already uses the correct BEM selector in theme CSS;
   reinforce so success copy stays readable over faded fields. */
.contact-form.success .contact_form--feedback {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

/* BUG-008: row toggle must not cover expanded plan/price buttons.
   Theme sets max-height:none under #building/#search, so height:100%
   covers the open panel until .open hides the toggle — reinforce both. */
#building .flats__list-toggle,
#search .flats__list-toggle {
  max-height: 56px !important;
  height: 56px !important;
}

#building .flats__list_flat.open > .flats__list-toggle,
#search .flats__list_flat.open > .flats__list-toggle {
  display: none !important;
  pointer-events: none !important;
}

#building .flat-item-btns,
#search .flat-item-btns {
  position: relative;
  z-index: 40;
}

#building .flat-item-btns .dl_btn--toggle,
#building .flat-item-btns .contact_btn--toggle,
#search .flat-item-btns .dl_btn--toggle,
#search .flat-item-btns .contact_btn--toggle {
  position: relative;
  z-index: 41;
  pointer-events: auto !important;
}

/* BUG-009: custom checkboxes must receive pointer hits */
.dl_form--input__checkbox,
.contact_form--input__checkbox {
  pointer-events: auto !important;
  cursor: pointer;
  z-index: 2;
  flex-shrink: 0;
}

.dl_form--field-type-checkbox,
.contact_form--field-type-checkbox {
  position: relative;
  z-index: 5;
  align-items: flex-start;
}

.dl_form--field-type-checkbox .dl_form--label,
.contact_form--field-type-checkbox .contact_form--label {
  pointer-events: auto;
  cursor: pointer;
}

/* Privacy link stays clickable without swallowing the whole label */
.dl_form--field-type-checkbox .dl_form--label a,
.contact_form--field-type-checkbox .contact_form--label a {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

/* Close button: theme pins it to the left edge (left:-25px, sticky mid-height),
   which both covers the consent checkbox and hides the X after success.
   Desktop: sit it top-right inside the teal panel. Tablet/mobile keep the
   theme's top bar (max-width: 960px). */
@media (min-width: 961px) {
  .dl_form--btn_close-wrapper,
  .contact_form--btn_close-wrapper {
    top: 28px;
    right: 28px;
    left: auto;
    height: 50px;
    width: 50px;
    z-index: 60;
  }

  .dl_form--btn_close,
  .contact_form--btn_close {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 60;
  }
}

.dl_form--wrapper:has(form.success) .dl_form--btn_close,
.contact_form--wrapper:has(form.success) .contact_form--btn_close {
  background-color: #b6cdce;
}

/* BUG-006: keep scroll disc from covering the intro CTA on mobile */
@media (max-width: 960px) {
  .flexible_intro-text {
    position: relative;
    z-index: 20;
  }

  .flexible_intro-text .button {
    position: relative;
    z-index: 21;
  }

  .flexible_intro-scroll_wrapper {
    z-index: 5;
  }

  .flexible_intro-scroll {
    left: 12px !important;
    bottom: 24px !important;
  }
}

@media (max-width: 500px) {
  .flexible_intro-scroll {
    left: 8px !important;
    bottom: 16px !important;
    width: 48px !important;
    height: 48px !important;
  }
}

/* BUG-010: clearer separation between desktop nav labels */
@media (min-width: 961px) {
  body:not(.home) .main_menu--item-link,
  .menu-sticky .main_menu--item-link {
    font-size: 13px;
    letter-spacing: 0.6px;
    padding: 0 clamp(8px, calc((100vw - 1000px) / 18), 18px) !important;
  }
}

/* BUG-003 helper: visually hidden but available to AT / outline */
.eveil-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
