/* Business broadband availability checker (checker.js): a card under the hero with the postcode and
   address on the right, and the result across the full width beneath. Fields and buttons match the
   leased line quote form. */

/* The site's display rules would otherwise override [hidden]. */
.bbc[hidden],
.bbc [hidden],
[data-bbc-link][hidden] { display: none !important; }

.bbc {
  display: grid;
  gap: 1.25rem 2rem;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(11, 44, 71, 0.08);
  scroll-margin-top: 6rem;
}
@media (min-width: 860px) {
  .bbc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
  .bbc-result { grid-column: 1 / -1; }
}

.bbc-intro h2 { margin: 0 0 0.5rem; color: var(--primary); }
.bbc-intro p { margin: 0; color: var(--muted); }

.bbc-row { display: flex; gap: 0.75rem; align-items: end; }
.bbc-row .bbc-field { flex: 1; margin-bottom: 0; }
.bbc-field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.bbc-field label { font-weight: 700; color: var(--primary); }
.bbc-field input,
.bbc-field select {
  width: 100%;
  border: 1px solid #c9d7e6;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0.75rem 0.85rem;
}
#bbc-postcode { text-transform: uppercase; font-size: 1.1rem; letter-spacing: 0.02em; }
.bbc-field input[aria-invalid="true"] { border-color: #b42318; }
.bbc-field input:focus,
.bbc-field select:focus { outline: 3px solid rgba(27, 108, 168, 0.18); border-color: var(--accent); }
/* The address list sits where the postcode row was, with "Change postcode" beside its label. */
#bbc-address-field { margin: 0; }
.bbc-field-head { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.bbc-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.bbc-link:hover,
.bbc-link:focus-visible { color: #155584; }
.bbc-link:focus-visible { outline: 3px solid rgba(27, 108, 168, 0.3); outline-offset: 2px; border-radius: 3px; }

.bbc-primary {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
  cursor: pointer;
}
.bbc-primary:hover,
.bbc-primary:focus-visible { background: #155584; border-color: #155584; }
.bbc-primary:focus-visible { outline: 3px solid rgba(27, 108, 168, 0.3); outline-offset: 2px; }
.bbc-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.bbc-turnstile { min-height: 65px; margin: 0.75rem 0 0; }
.bbc-status { margin: 0.5rem 0 0; min-height: 1.4em; color: var(--muted); font-size: 0.95rem; }
.bbc-status.is-error { color: #b42318; font-weight: 600; }
.bbc-check-progress { display: block; width: 100%; height: 10px; margin-top: 1rem; overflow: hidden; border: 0; border-radius: 999px; background: #e1e9f2; accent-color: var(--accent); appearance: none; -webkit-appearance: none; }
.bbc-check-progress::-webkit-progress-bar { border-radius: 999px; background: #e1e9f2; }
.bbc-check-progress::-webkit-progress-value { border-radius: 999px; background: var(--accent); }
.bbc-check-progress::-moz-progress-bar { border-radius: 999px; background: var(--accent); }

.bbc-result { display: grid; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* The map sits above the result on phones and to its right on wider screens, where the provider card
   and the map share one height: whichever is taller sets it, and the other stretches to match. */
.bbc-result-body,
.bbc-result-main { display: grid; gap: 1rem; align-content: start; }
.bbc-map { margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #eef3f8; }
.bbc-map-view { position: relative; height: 220px; overflow: hidden; background: #e8eef3; }
@media (min-width: 860px) {
  .bbc-result-body.has-map { grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; }
  .bbc-result-body.has-map > .bbc-map { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; }
  .bbc-result-body.has-map > .bbc-result-main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; }
  .bbc-result-body.has-map .bbc-avail-card { flex: 1; }
  .bbc-result-body.has-map .bbc-map-view { flex: 1; height: auto; min-height: 260px; }
}
/* Fixed tiles: nothing to drag, zoom or select. The site's img rules would otherwise resize them. */
.bbc-map-tiles { position: absolute; pointer-events: none; user-select: none; }
.bbc-map-tiles img { position: absolute; width: 256px; max-width: none; height: 256px; }
.bbc-map-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.bbc-map-credit {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0.1rem 0.4rem;
  border-top-left-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-size: 0.72rem;
  text-decoration: none;
}
.bbc-map figcaption { padding: 0.45rem 0.75rem; color: var(--muted); font-size: 0.85rem; }

/* Package choices lead to the totals and Continue button at the bottom of the card. */
.bbc-avail-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  align-content: start;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfdff;
}
.bbc-networks { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; min-width: 0; }
/* Up to 36px tall and 200px wide, shrinking to fit a narrow card without stretching. */
.bbc-network-logo { display: block; width: auto; height: auto; max-width: min(200px, 100%); max-height: 36px; }
/* Freedom Fibre's logo is two lines deep, so it needs more height to read at the same size. */
.bbc-network-logo[data-network="freedomfibre"] { max-height: 48px; }
.bbc-network-name { color: var(--primary); font-size: 1.15rem; font-weight: 800; }
.bbc-avail-list { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.bbc-avail { display: flex; gap: 0.65rem; align-items: center; color: var(--primary); font-size: 1.05rem; font-weight: 700; }
/* "(Existing ONT)" or "(New Install)" after Full Fibre. */
.bbc-avail-note { color: var(--muted); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

/* The speed and contract length sliders, styled like the leased line quote's. --fill is set by
   checker.js. */
.bbc-speed-picker { display: grid; gap: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.bbc-slider { display: grid; gap: 0.5rem; }
.bbc-speed-head { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; justify-content: space-between; }
.bbc-speed-head label { color: var(--primary); font-weight: 700; }
.bbc-speed-head output { color: var(--primary); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bbc-range { width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.bbc-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), #e1e9f2 var(--fill, 0%));
}
.bbc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(15, 58, 95, 0.25);
}
.bbc-range::-moz-range-track { height: 8px; border-radius: 999px; background: #e1e9f2; }
.bbc-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--accent); }
.bbc-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 6px rgba(15, 58, 95, 0.25); }
.bbc-range:focus-visible { outline: none; }
.bbc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(27, 108, 168, 0.3); }
.bbc-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px rgba(27, 108, 168, 0.3); }
/* Under the speed slider when fibre to the cabinet shows the line's estimate. */
.bbc-estimate { margin: 0; color: var(--muted); font-size: 0.85rem; font-style: italic; }
.bbc-router-choice { min-width: 0; margin: 0; padding: 1rem 0 0; border: 0; border-top: 1px solid var(--border); container-type: inline-size; }
.bbc-router-choice legend { padding: 0 0.5rem 0 0; color: var(--primary); font-weight: 700; }
.bbc-router-options { display: grid; gap: 0.9rem; padding: 0.25rem 4px 5px 0; }
.bbc-router-option { position: relative; min-width: 0; }
.bbc-router-card { position: relative; display: flex; gap: 0.8rem; align-items: center; height: 100%; min-width: 0; box-sizing: border-box; padding: 1.6rem 0.9rem 0.9rem; border: 2px solid #102f54; border-radius: 12px; background: #f8f5ec; box-shadow: 3px 4px 0 #102f54; color: #102f54; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.bbc-router-art { flex: 0 0 100px; width: 100px; height: auto; }
.bbc-router-copy { display: grid; gap: 0.35rem; min-width: 0; }
.bbc-router-title { font-size: 1rem; font-weight: 800; }
.bbc-router-description { color: #526479; font-size: 0.85rem; }
.bbc-router-copy strong { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.bbc-router-selected { display: none; position: absolute; top: 0.35rem; right: 0.65rem; color: var(--accent); font-size: 0.7rem; font-weight: 800; }
.bbc-router-card:hover { background: #f2f4ed; }
.bbc-router-option input:checked + .bbc-router-card { border-color: var(--accent); background: #edf4f9; }
.bbc-router-option input:checked + .bbc-router-card .bbc-router-selected { display: block; }
.bbc-router-option input:focus-visible + .bbc-router-card { outline: 3px solid rgba(27, 108, 168, 0.4); outline-offset: 3px; }
@container (min-width: 440px) {
  .bbc-router-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bbc-router-card { flex-direction: column; align-items: flex-start; }
  .bbc-router-art { flex-basis: auto; width: 120px; }
}
@container (min-width: 660px) {
  .bbc-router-card { flex-direction: row; align-items: center; }
  .bbc-router-art { flex: 0 0 105px; width: 105px; }
}
/* Optional Extras: the router, then 4G backup once a router option is picked. */
.bbc-router-choice > legend { font-size: 1.05rem; }
.bbc-extra { display: grid; gap: 0.4rem; min-width: 0; margin: 0.75rem 0 0; padding: 0; border: 0; }
.bbc-extra legend { margin-bottom: 0.4rem; padding: 0; color: var(--primary); font-size: 0.95rem; font-weight: 700; }
.bbc-router-card.is-plain { padding-top: 1.6rem; }
.bbc-continue:disabled { background: #a7b2be; border-color: #a7b2be; box-shadow: none; opacity: 1; }

/* The order step: summary, totals, contact details and go-live date. */
.bbc-order { display: grid; gap: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); scroll-margin-top: 6rem; }
.bbc-order-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; justify-content: space-between; }
.bbc-order-head h3 { margin: 0; color: var(--primary); font-size: 1.2rem; }
.bbc-order-summary { display: grid; gap: 0.6rem; margin: 0; }
.bbc-order-summary div { display: grid; grid-template-columns: minmax(7.5rem, 30%) minmax(0, 1fr); gap: 1rem; }
.bbc-order-summary dt { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.bbc-order-summary dd { margin: 0; color: var(--primary); font-weight: 700; }
.bbc-order .bbc-totals { padding-top: 1rem; border-top: 1px solid var(--border); }
.bbc-order-form { display: grid; gap: 0 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.bbc-order-form .bbc-field label span { color: var(--muted); font-weight: 500; }
.bbc-order-form .bbc-status { margin: 0 0 0.75rem; }
.bbc-hint { margin: 0; color: var(--muted); font-size: 0.85rem; }
.bbc-place-order { justify-self: end; }
@media (min-width: 600px) {
  .bbc-order-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bbc-field-full,
  .bbc-place-order { grid-column: 1 / -1; }
}

/* After Place Order the whole checker shows this, with the enquiry-sent page's tick (styles.css). */
.bbc-ordered { grid-column: 1 / -1; display: grid; justify-items: center; gap: 1rem; padding: 1.5rem 0; text-align: center; outline: none; }
.bbc-ordered h2 { margin: 0; color: var(--primary); }
.bbc-ordered p { max-width: 46ch; margin: 0; color: var(--muted); font-size: 1.05rem; }
.bbc-ordered-ref strong { color: var(--primary); }

.bbc-summary { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: end; justify-content: space-between; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.bbc-totals { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 0; color: var(--primary); }
.bbc-totals dt { margin-bottom: 0.35rem; font-size: 0.9rem; font-weight: 700; }
.bbc-totals dd { margin: 0; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bbc-totals dd span { margin-left: 0.4rem; color: var(--muted); font-size: 0.8rem; font-weight: 500; white-space: nowrap; }
.bbc-continue { margin-left: auto; }
.bbc-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.is-on .bbc-dot { background: #1f8a4c; box-shadow: 0 0 0 4px rgba(31, 138, 76, 0.16); }
.is-off .bbc-dot { background: #c62828; box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.14); }
/* Read out by screen readers ("available" / "not available"), not shown. */
.bbc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bbc-note { margin: 0; color: var(--muted); }

@media (max-width: 480px) {
  .bbc-row { flex-direction: column; align-items: stretch; }
  .bbc-avail-card { padding: 1rem; }
  .bbc-totals { gap: 1rem 1.25rem; }
  .bbc-totals dd { font-size: 1.25rem; }
  .bbc-place-order { justify-self: stretch; }
  .bbc-order-summary div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}
