/* ==========================================================================
   "Do we cover your area?" postcode checker
   Markup: _build/checker.py   Behaviour: assets/js/area-check.js
   Uses the brand tokens from site.css (--blue, --red, --ink, --font-head ...)
   ========================================================================== */

/* ---------- Home hero postcode bar (replaces the "Get a free quote" button) ---------- */
.hero-postcode { max-width: 620px; margin: 0 0 18px; }
.hero-postcode-label {
  display: block; margin-bottom: 12px;
  font-family: var(--font-head); font-weight: 900; font-style: italic; font-size: clamp(1.35rem, 1rem + 1vw, 1.7rem); line-height: 1.1; color: var(--ink);
}
.hero-postcode-label span { display: block; margin-top: 6px; font-family: var(--font-body); font-style: normal; font-weight: 500; font-size: 1rem; color: var(--text); }
.hero-postcode-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 22px;
  background: var(--white); border: 2px solid var(--blue); border-radius: 999px;
  box-shadow: 0 22px 46px -20px rgba(0, 101, 173, .55); transition: box-shadow .25s;
}
.hero-postcode-bar:focus-within { box-shadow: 0 22px 46px -20px rgba(0, 101, 173, .55), 0 0 0 5px rgba(0, 101, 173, .16); }
.hero-postcode-bar > i { flex: none; font-size: 1.25rem; color: var(--red); }
.hero-postcode-bar input {
  flex: 1 1 auto; min-width: 0; min-height: 54px; padding: 0 4px; border: 0; background: transparent;
  font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink);
}
.hero-postcode-bar input::placeholder { font-weight: 600; letter-spacing: 0; text-transform: none; color: #8A9396; }
.hero-postcode-bar input:focus { outline: none; }
.hero-postcode-bar .btn { flex: none; }
.hero-cta--postcode { margin-top: 0; }

/* ---------- Smaller bar on the area and service pages ---------- */
.page-postcode {
  max-width: 520px; margin: 22px 0 0; padding: 16px 18px 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.page-postcode-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.page-postcode-label i { color: var(--red); }
.page-postcode-bar { display: flex; gap: 8px; }
.page-postcode-bar input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--mist);
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink);
}
.page-postcode-bar input::placeholder { font-weight: 600; letter-spacing: 0; text-transform: none; color: #8A9396; }
.page-postcode-bar input:focus { outline: 0; border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 4px rgba(0, 101, 173, .14); }
.page-postcode-bar .btn { min-height: 48px; padding: 0 24px; }
.page-postcode-note { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }

/* ---------- The pop-up ---------- */
.ac-dialog {
  width: min(1080px, calc(100% - 40px)); max-width: none; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 0;
  border-radius: var(--radius); background: var(--white); color: var(--text); box-shadow: 0 40px 120px rgba(11, 35, 64, .5);
  overflow: auto; overscroll-behavior: contain;
}
.ac-dialog[open] { animation: acPop .35s var(--ease); }
.ac-dialog::backdrop { background: rgba(11, 35, 64, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes acPop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.ac-close {
  position: absolute; z-index: 5; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--mist); font-size: 1.2rem; color: var(--ink); cursor: pointer; transition: background .2s, color .2s;
}
.ac-close:hover { background: var(--blue-tint); color: var(--blue); }
html.ac-open { overflow: hidden; }

.ac { --ac-progress: 20%; display: flex; align-items: stretch; min-height: 600px; }

/* Side panel (desktop only) */
.ac-aside {
  flex: 0 0 34%; display: flex; flex-direction: column; gap: 22px; padding: 40px 34px; color: var(--white);
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .14), transparent 60%), linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 55%, var(--blue-ink) 100%);
}
.ac-aside-logo { width: 150px; height: auto; border-radius: 8px; background: var(--white); padding: 6px 10px; }
.ac-aside-title { margin: 0; font-family: var(--font-head); font-weight: 900; font-style: italic; font-size: 1.6rem; line-height: 1.1; color: var(--white); }
.ac-aside-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: .98rem; line-height: 1.4; }
.ac-aside-points li { display: flex; gap: 10px; align-items: flex-start; }
.ac-aside-points i { flex: none; margin-top: 3px; color: var(--gold); }
.ac-quote { margin: auto 0 0; padding: 20px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.ac-quote-stars { display: flex; gap: 3px; margin-bottom: 10px; color: var(--gold); font-size: .9rem; }
.ac-quote blockquote { margin: 0; font-size: 1rem; line-height: 1.55; font-style: italic; }
.ac-quote figcaption { margin-top: 10px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }

/* Main column */
.ac-main { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 40px 44px 36px; }
.ac-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-right: 52px; }
.ac-kicker { margin: 0; font-family: var(--font-head); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.ac-stepcount { margin: 0 0 0 auto; font-size: .85rem; font-weight: 600; color: var(--muted); }
.ac-meter { flex: 1 1 100%; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.ac-meter-fill { display: block; height: 100%; width: var(--ac-progress); border-radius: inherit; background: linear-gradient(90deg, var(--blue), #2B8AD3); transition: width .5s var(--ease); }
.ac-chip { align-self: flex-start; display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--blue-tint); font-size: .92rem; font-weight: 600; color: var(--ink); }
.ac-chip i { color: var(--red); }
.ac-chip-edit { border: 0; background: var(--white); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: .85rem; color: var(--blue); cursor: pointer; }
.ac-chip-edit:hover { background: var(--blue); color: var(--white); }
.ac-chip[hidden] { display: none; }

.ac-form { display: flex; flex-direction: column; }
.ac-step { display: flex; flex-direction: column; gap: 18px; outline: none; }
.ac-step[hidden], .ac-group[hidden], .ac-done[hidden], .ac-form[hidden], .ac-stay[hidden], .ac-photo-clear[hidden] { display: none; }
.ac-enter { animation: acIn .4s var(--ease); }
@keyframes acIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ac-title { margin: 0; padding: 0; font-family: var(--font-head); font-weight: 900; font-style: italic; font-size: clamp(1.55rem, 1.1rem + 1.2vw, 2.1rem); line-height: 1.1; letter-spacing: -.015em; color: var(--ink); }
.ac-sub { margin: -8px 0 0; font-size: 1.02rem; color: var(--text); }

.ac-postcode { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 20px; border: 2px solid var(--line); border-radius: 999px; background: var(--white); transition: border-color .2s, box-shadow .2s; }
.ac-postcode:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 101, 173, .14); }
.ac-postcode > i { flex: none; font-size: 1.15rem; color: var(--red); }
.ac-postcode input { flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 0 4px; border: 0; font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); background: transparent; }
.ac-postcode input:focus { outline: none; }
.ac-postcode input::placeholder { font-weight: 600; letter-spacing: 0; text-transform: none; color: #8A9396; }
.ac-postcode .btn { flex: none; }
.ac.is-busy .ac-postcode .btn { opacity: .6; pointer-events: none; }
.ac.is-busy .ac-postcode .btn::after { content: ''; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: acSpin .7s linear infinite; }
@keyframes acSpin { to { transform: rotate(360deg); } }
.ac-error { margin: 0; color: var(--red-deep); font-weight: 600; font-size: .98rem; }
.ac-error[hidden] { display: none; }
.ac-reassure, .ac-safe { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .92rem; color: var(--muted); }
.ac-reassure i, .ac-safe i { color: var(--blue); }

.ac-result { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--blue-tint), var(--mist)); border: 1px solid #CFE2F2; }
.ac-result strong { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; line-height: 1.2; color: var(--ink); }
.ac-result p { margin: 3px 0 0; font-size: .95rem; line-height: 1.45; color: var(--text); }
.ac-tick { flex: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: var(--white); font-size: 1.1rem; box-shadow: 0 8px 18px -6px rgba(0, 101, 173, .6); }
.ac.is-outside .ac-result { background: linear-gradient(90deg, #FDEFEF, var(--mist)); border-color: #F3CFCF; }
.ac.is-outside .ac-tick { background: var(--red); box-shadow: 0 8px 18px -6px rgba(207, 24, 28, .55); }

.ac-options-set, .ac-pills { border: 0; margin: 0; padding: 0; min-width: 0; }
.ac-options-set legend { margin-bottom: 12px; }
.ac-options-head { margin: 6px 0 10px; font-family: var(--font-head); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ac-options { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-options + .ac-options-head { margin-top: 18px; }
.ac-options--other { margin-top: 10px; }
.ac-options .ac-option--featured { flex: 0 0 100%; }
.ac-option--featured .ac-option-box { min-height: 88px; padding: 16px 20px; border: 2px solid var(--blue); background: linear-gradient(90deg, var(--blue-tint), var(--white) 70%); box-shadow: var(--shadow-sm); }
.ac-option--featured .ac-option-icon { width: 52px; height: 52px; background: var(--blue); color: var(--white); font-size: 1.3rem; }
.ac-option--featured .ac-option-text strong { font-size: 1.18rem; }
.ac-option-badge { align-self: flex-start; margin-bottom: 2px; padding: 2px 10px; border-radius: 999px; background: var(--red); color: var(--white); font-family: var(--font-head); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ac-option { flex: 0 0 calc((100% - 10px) / 2); min-width: 0; position: relative; cursor: pointer; }
.ac-option input, .ac-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-option-box {
  height: 100%; min-height: 74px; display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink);
  transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}
.ac-option-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-tint); color: var(--blue); font-size: 1.1rem; transition: background .2s, color .2s; }
.ac-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ac-option-text strong { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.ac-option-text small { font-size: .86rem; line-height: 1.3; color: var(--muted); }
.ac-option:hover .ac-option-box { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ac-option input:focus-visible + .ac-option-box { box-shadow: 0 0 0 3px var(--gold); }
.ac-option input:checked + .ac-option-box { border-color: var(--blue); background: var(--blue-tint); }
.ac-option input:checked + .ac-option-box .ac-option-icon { background: var(--blue); color: var(--white); }

.ac-group { display: flex; flex-direction: column; gap: 18px; }
.ac-pills legend { margin-bottom: 8px; font-family: var(--font-head); font-size: .98rem; font-weight: 800; color: var(--ink); }
.ac-pills.is-missing legend { color: var(--red); }
.ac-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-pill { position: relative; cursor: pointer; }
.ac-pill span { display: block; padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); font-size: .96rem; font-weight: 600; line-height: 1.3; color: var(--ink); transition: border-color .2s, background .2s, color .2s, box-shadow .2s; }
.ac-pills--small .ac-pill span { min-width: 56px; text-align: center; }
.ac-pill:hover span { border-color: var(--blue); }
.ac-pill input:focus-visible + span { box-shadow: 0 0 0 3px var(--gold); }
.ac-pill input:checked + span { background: var(--blue); border-color: var(--blue); color: var(--white); box-shadow: 0 6px 14px -6px rgba(0, 101, 173, .7); }
.ac-pills.is-missing .ac-pill span { border-color: rgba(207, 24, 28, .5); }

.ac-photo { display: flex; flex-direction: column; gap: 8px; }
.ac-photo-label { font-family: var(--font-head); font-size: .98rem; font-weight: 800; color: var(--ink); }
.ac-photo-label small, .ac-main .field label small { font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--muted); }
.ac-photo-drop { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1.5px dashed #B9CBDA; border-radius: 14px; background: var(--mist); cursor: pointer; font-weight: 600; color: var(--blue); transition: border-color .2s, background .2s; }
.ac-photo-drop i { font-size: 1.2rem; }
.ac-photo-drop:hover { border-color: var(--blue); background: var(--blue-tint); }
.ac-photo.has-photo .ac-photo-drop { border-style: solid; border-color: var(--blue); background: var(--blue-tint); color: var(--ink); }
.ac-photo-drop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-photo-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-photo-input:focus-visible + .ac-photo-clear, .ac-photo:focus-within .ac-photo-drop { box-shadow: 0 0 0 3px var(--gold); }
.ac-photo-clear { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; }
.ac-photo-clear:hover { color: var(--red); }
.ac-hint { margin: 0; font-size: .86rem; color: var(--muted); }

.ac-row { display: flex; gap: 14px; }
.ac-row > .field { flex: 1 1 0; min-width: 0; }
.ac-main .field { margin-bottom: 0; }
.ac-main textarea.field-input { min-height: 80px; }
.ac-consent { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; line-height: 1.45; color: var(--ink); cursor: pointer; }
.ac-consent input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); }
.ac-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.ac-nav .btn { margin-left: auto; }
.ac-back { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 0; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.ac-back:hover { color: var(--blue); }

.ac-done { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; flex: 1; text-align: center; outline: none; padding: 30px 0; }
.ac-done > p { margin: 0; max-width: 480px; font-size: 1.08rem; color: var(--text); }
.ac-tick--big { width: 76px; height: 76px; font-size: 2rem; margin-bottom: 4px; }
.ac.is-done { --ac-progress: 100%; }

.ac-stay { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; padding: 120px 48px 48px; background: rgba(255, 255, 255, .97); animation: acIn .3s var(--ease); }
.ac-stay p { margin: 0; font-size: 1.08rem; color: var(--text); }

@media (max-width: 960px) {
  .ac-aside { display: none; }
  .ac { min-height: 0; }
}
@media (max-width: 767px) {
  /* phones: the postcode box comes straight after the headline, above the fold */
  .hero-content { display: flex; flex-direction: column; }
  .hero-eyebrow { align-self: flex-start; }
  .hero-postcode { order: 1; margin-bottom: 22px; }
  .hero-sub { order: 2; }
  .hero-cta { order: 3; }
  .hero-points { order: 4; }
  .hero-postcode-label { font-size: 1.3rem; }
  .hero-postcode-label span { font-size: .95rem; }
  .hero-postcode-bar { padding: 6px 6px 6px 16px; gap: 6px; }
  .hero-postcode-bar input { min-height: 50px; font-size: 1.12rem; }
  .hero-postcode-bar .btn { min-height: 50px; padding: 0 16px; font-size: .92rem; }
  .ac-dialog { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .ac-dialog[open] { animation: none; }
  .ac-main { padding: 18px 16px 28px; gap: 16px; }
  .ac-top { padding-right: 50px; }
  .ac-close { top: 10px; right: 10px; }
  .ac-title { font-size: 1.45rem; }
  .ac-result { padding: 12px 14px; gap: 12px; }
  .ac-result strong { font-size: 1.05rem; }
  .ac-tick { width: 34px; height: 34px; font-size: .95rem; }
  .ac-option { flex-basis: 100%; }
  .ac-option-box { min-height: 64px; padding: 10px 12px; gap: 12px; }
  .ac-option-icon { width: 40px; height: 40px; }
  .ac-pill span { padding: 10px 15px; font-size: .94rem; }
  .ac-postcode { padding: 5px 5px 5px 14px; }
  .ac-postcode .btn { padding: 0 20px; }
  .ac-row { flex-direction: column; gap: 14px; }
  .ac-nav .btn { flex: 1 1 auto; }
  .ac-stay { padding: 28px 20px; }
}
@media (max-width: 380px) {
  .hero-postcode-bar > i { display: none; }
  .hero-postcode-bar .btn { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-enter, .ac-dialog[open], .ac-stay { animation: none; }
  .ac-option:hover .ac-option-box { transform: none; }
}
