/* Shared accessibility, interaction and narrow-screen safeguards. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html, body {
  overflow-x: hidden;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; }

:where(a, button, input, summary, [role="button"]):focus-visible {
  outline: 3px solid #005bf4;
  outline-offset: 3px;
}

/* Keep the accordion focus indicator inside the header so it never crosses
   the first line of the expanded answer. */
.faq-header:focus-visible {
  outline: none;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px #005bf4;
}

/* Text fields use one compact focus line that follows their rounded edge. */
:where(
  .calc-input-sm,
  .calc-phone-input,
  .form-input,
  .phone-field,
  .lead-modal__input,
  .lead-modal__phone-input,
  .rm__calc-input
):focus-visible {
  outline: none;
}

:where(.calc-input-sm, .form-input, .lead-modal__input, .rm__calc-input):focus-visible,
:where(.calc-phone-wrap, .phone-input, .lead-modal__phone-wrap):has(input:focus-visible) {
  border-color: #005bf4;
  box-shadow: inset 0 0 0 2px #005bf4;
}

a[aria-disabled="true"] {
  pointer-events: none;
  opacity: .45;
  cursor: not-allowed;
}

.room-card input,
.repair-option input,
.calc-checkbox input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}

.room-card:has(input:focus-visible),
.repair-option:has(input:focus-visible),
.calc-checkbox:has(input:focus-visible),
.privacy-row:has(input:focus-visible) {
  outline: 3px solid #005bf4;
  outline-offset: 3px;
}

.privacy-checkbox:checked + .checkbox-box,
.calc-checkbox input:checked + .cb-box {
  background: #005bf4;
  border-color: #005bf4;
}

.privacy-checkbox:checked + .checkbox-box::after {
  opacity: 1;
}

.field-error { border-color: #b42318 !important; background: #fff5f5 !important; }
.field-error-message {
  display: block;
  width: 100%;
  margin: 6px 4px 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

/* Validation belongs directly to its field, never inside the input row. */
.lead-modal__input + .field-error-message {
  margin: -6px 4px 12px;
}

.lead-modal__phone-wrap + .field-error-message {
  margin: -14px 4px 14px;
}

.consent-error-message {
  display: block;
  margin: 6px 4px 12px;
  color: #9f241d;
  font-size: 13px;
  line-height: 1.4;
}

.lead-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #697386;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

/* Preserve clear breathing room between the legal row and the primary CTA
   in both the desktop dialog and the mobile bottom sheet. */
.lead-modal .lead-consent {
  margin: 0 0 18px;
}

.lead-consent input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  accent-color: #005bf4;
  cursor: pointer;
}

.lead-consent > span {
  display: block;
  flex: 1;
  min-width: 0;
}

.lead-consent a,
.form-status a {
  color: #005bf4;
  text-underline-offset: 2px;
}

.form-privacy-note {
  margin: 4px 0 16px 30px;
  color: #697386;
  font-size: 12px;
  line-height: 1.5;
}

.form-privacy-note a {
  color: #005bf4;
  text-underline-offset: 2px;
}

.lead-consent--error {
  padding: 9px 10px;
  border: 1px solid #f4b8b4;
  border-radius: 12px;
  background: #fff7f6;
  color: #9f241d;
}

.calc-consent {
  margin: 0 24px 12px;
  padding: 0;
}

/* Keep the calculator's validation state balanced and aligned with the form. */
.calc-consent.lead-consent--error {
  padding: 12px 14px;
}

.calc-consent + .consent-error-message {
  margin: -4px 24px 8px;
}

.calc-privacy-note {
  margin: -8px 24px 12px;
}

.calc-consent + .consent-error-message + .calc-privacy-note {
  margin-top: 0;
}

.form-status {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.form-status:empty { display: none; }

@media (max-width: 640px) {
  /* One compact legal row with predictable wrapping above the CTA. */
  .lead-modal .lead-consent {
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.4;
  }

  /* Centre the close control against the complete eyebrow + title block. */
  .lead-modal__close {
    top: 35px;
  }
}
.form-status--error { border: 1px solid #f4b8b4; background: #fff1f0; color: #9f241d; }
.form-status--info { border: 1px solid #b9d3ff; background: #eef5ff; color: #174b9e; }

button[aria-busy="true"] {
  cursor: wait;
  opacity: 1;
}

.button-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.button-loading__spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-loading-spin .7s linear infinite;
}

@keyframes button-loading-spin {
  to { transform: rotate(360deg); }
}

button:disabled { cursor: not-allowed; }

.header-nav a,
.header-cta-btn,
.header-burger,
.header-phone-btn,
.mobile-menu__close,
.lead-modal__close,
.phone-modal__close,
.rm__close,
.ctrl-btn,
.case-slider__btn,
.rm__chip {
  min-width: 44px;
  min-height: 44px;
}

.polygon-dot {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  transform: none;
}
.polygon-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8d8d8;
  transform: translate(-50%, -50%);
  transition: background .2s, transform .2s;
}
.polygon-dot--active { background: transparent; transform: none; }
.polygon-dot--active::after {
  background: #1465fc;
  transform: translate(-50%, -50%) scale(1.45);
}

.room-modal__dot {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background-clip: content-box;
  cursor: pointer;
}
.room-modal__close,
.room-modal__btn { min-width: 44px; min-height: 44px; }

.rm__close,
.lead-modal__close,
.phone-modal__close { min-width: 48px; min-height: 48px; }
.rm__chip { min-height: 46px; }

.counter-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.counter-card { min-width: 0; }

.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  color: #222;
}
.legal-page h1 { font: 800 clamp(32px, 5vw, 52px)/1.1 var(--font-heading); margin-bottom: 24px; }
.legal-page h2 { font-size: 22px; margin: 32px 0 12px; }
.legal-page p, .legal-page li { font-size: 16px; line-height: 1.7; color: #4b5563; }
.legal-page a { color: #005bf4; }

@media (max-width: 768px) {
  h1,
  h2,
  h3 {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .counter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .counter-card { padding: 20px; }
  .counter-val { font-size: clamp(38px, 12vw, 48px); }
  .legal-page { padding: 92px 18px 56px; }
}

@media (max-width: 360px) {
  .counter-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .button-loading__spinner {
    animation: none;
  }

  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .calc-success__logo,
  .calc-success__icon,
  .calc-success__copy {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .calc-success__check {
    animation: none !important;
    stroke-dashoffset: 0;
  }
}
