/* Loans for Bad Credit UK — hand-written styles.
 *
 * The page markup and nearly all of its styling come from the design snapshots,
 * which carry every rule inline. This file holds only what a static document
 * cannot: progressive-enhancement states, focus, motion preferences and the
 * behaviour of the pieces site.js drives.
 */

/* --- Progressive enhancement ---------------------------------------------
 * Accordion answers and the mobile menu ship in the HTML so they are readable
 * and indexable with no JavaScript. They are only collapsed once site.js is
 * there to open them again, so a reader without JS sees every answer rather
 * than a row of dead buttons. The inline styles carried by the captured markup
 * are specific, hence !important.
 */
html.lfbc-js [data-lfbc-panel][hidden],
html.lfbc-js [data-lfbc-menu][hidden] {
  display: none !important;
}

/* Without JS the toggle cannot do anything, so it should not look like it can. */
html:not(.lfbc-js) [data-lfbc-toggle] {
  cursor: default;
}
html:not(.lfbc-js) [data-lfbc-toggle] svg {
  display: none;
}

/* --- Focus ---------------------------------------------------------------
 * The handoff specifies a green ring on every interactive element. Applied
 * with :focus-visible so a mouse click does not leave one behind.
 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #54e44c;
  outline-offset: 3px;
}

/* --- Range sliders -------------------------------------------------------
 * 12px track, black fill to the left of the thumb, 28px green thumb with a
 * black border. The fill is painted from a --pct custom property that site.js
 * keeps in step with the value.
 */
input[type="range"].lfbc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  /* The build strips the prototype's frozen inline fill; !important keeps any
     that survives from painting a stale bar behind the real track. */
  background: transparent !important;
  cursor: pointer;
}
input[type="range"].lfbc-range::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #000 0%, #000 var(--pct, 0%),
    #e5e9f2 var(--pct, 0%), #e5e9f2 100%
  );
}
input[type="range"].lfbc-range::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #000 0%, #000 var(--pct, 0%),
    #e5e9f2 var(--pct, 0%), #e5e9f2 100%
  );
}
input[type="range"].lfbc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -8px;
  border-radius: 50%;
  background: #54e44c;
  border: 2px solid #000;
  box-shadow: 0 2px 0 #000;
}
input[type="range"].lfbc-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #54e44c;
  border: 2px solid #000;
  box-shadow: 0 2px 0 #000;
}

/* --- Mobile menu ---------------------------------------------------------
 * The panel is fixed under the header; site.js sets --lfbc-menu-top to the
 * header's bottom edge and locks body scroll while it is open.
 */
[data-lfbc-menu] {
  top: var(--lfbc-menu-top, 0px) !important;
}
body.lfbc-menu-open {
  overflow: hidden;
}

/* --- Copy buttons --------------------------------------------------------
 * "Copied" confirmation swaps the label for a couple of seconds.
 */
[data-lfbc-copied] {
  position: relative;
}

/* --- Footer columns ------------------------------------------------------
 * The design lays the footer out as a wrapping flexbox, and the wide brand
 * block pushed the fourth link column onto its own line. A grid keeps the
 * brand and all four link columns on one row from 960px up, and lets them
 * wrap normally below that.
 */
@media (min-width: 960px) {
  [data-lfbc-footer-row] {
    display: grid !important;
    grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(0, 1fr));
    gap: 40px clamp(24px, 2.5vw, 56px) !important;
    align-items: start;
  }
  [data-lfbc-footer-row] > * {
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
  }
}

/* --- Guides index filter ------------------------------------------------- */
[data-lfbc-card][hidden] {
  display: none !important;
}

/* --- Motion --------------------------------------------------------------
 * The hero illustration and the step artwork loop. Respect the OS setting.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Skip link ----------------------------------------------------------- */
.lfbc-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: #000;
  color: #fff;
  font: 600 15px/1 "Instrument Sans", system-ui, sans-serif;
  border-radius: 0 0 8px 0;
}
.lfbc-skip:focus {
  left: 0;
}

/* --- Print ---------------------------------------------------------------
 * Several guides offer a printable worksheet or letter. Drop the furniture.
 */
@media print {
  [data-lfbc-menu],
  .lfbc-skip {
    display: none !important;
  }
  html.lfbc-js [data-lfbc-panel][hidden] {
    display: block !important;
  }
}
