* { margin: 0; padding: 0; box-sizing: border-box; }

/* The customer-facing pages. Same three modes as the panel and the field app:
   the stored choice wins, otherwise the visitor's own system setting does. */
:root {
  color-scheme: light;
  --map-ctrl-bg: #ffffff;
  --map-ctrl-line: rgba(15, 39, 66, 0.16);
  --map-ctrl-hover: #f1f5f9;
  --map-ctrl-filter: none;
  --teal: #2563eb;
  --teal-ink: #1d4ed8;
  --navy: #101f3c;
  --bg: #f7f5ee;
  --card: #ffffff;
  --ink: #1e2b3c;
  --muted: #5f6b7c;
  --line: #efebe0;
  --field-bg: #ffffff;
  --field-border: #d9d3c2;
  --field-soft: #faf8f2;
  --hover: #eef4ff;
  --landing-bg: #f7f5ee;
  --error: #c0392b;
  --error-bg: #fdecea;
  --warn-bg: #fff4e0;
  --warn-ink: #7a4d00;
  --footer-bg: #101f3c;
  --footer-link: #93c5fd;
  --hero-bg: linear-gradient(135deg, #3b82f6 0%, #1e40af 48%, #101f3c 100%);
  --offer-bg: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  --shadow: 0 6px 24px rgba(16, 34, 64, 0.12);
  --shadow-sm: 0 4px 16px rgba(16, 34, 64, 0.07);
  --btn-fill: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  --fresh-sky: radial-gradient(700px 360px at 90% -120px, rgba(250, 196, 96, 0.2), transparent 62%), radial-gradient(560px 320px at 0% -100px, rgba(120, 170, 255, 0.14), transparent 55%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --map-ctrl-bg: #16202f;
  --map-ctrl-line: rgba(255, 255, 255, 0.16);
  --map-ctrl-hover: #1e2a3c;
  --map-ctrl-filter: invert(0.92);
  --teal: #3b82f6;
  --teal-ink: #93b8fd;
  --navy: #16243a;
  --bg: #0b1018;
  --card: #131a26;
  --ink: #e7eef8;
  --muted: #93a3b8;
  --line: #232e42;
  --field-bg: #101827;
  --field-border: #35435c;
  --field-soft: #18212f;
  --hover: rgba(59, 130, 246, 0.12);
  --landing-bg: #0b1018;
  --error: #ff9a90;
  --error-bg: rgba(230, 90, 80, 0.16);
  --warn-bg: rgba(225, 155, 45, 0.16);
  --warn-ink: #e3a848;
  --footer-bg: #0a101b;
  --footer-link: #93b8fd;
  --hero-bg: linear-gradient(135deg, #1e3a8a 0%, #0f1a33 100%);
  --offer-bg: linear-gradient(135deg, #1d4ed8 0%, #16243a 100%);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --fresh-sky: radial-gradient(700px 360px at 90% -120px, rgba(251, 191, 36, 0.05), transparent 62%), radial-gradient(560px 320px at 0% -100px, rgba(59, 130, 246, 0.07), transparent 55%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --map-ctrl-bg: #16202f;
  --map-ctrl-line: rgba(255, 255, 255, 0.16);
  --map-ctrl-hover: #1e2a3c;
  --map-ctrl-filter: invert(0.92);
  --teal: #3b82f6;
  --teal-ink: #93b8fd;
  --navy: #16243a;
  --bg: #0b1018;
  --card: #131a26;
  --ink: #e7eef8;
  --muted: #93a3b8;
  --line: #232e42;
  --field-bg: #101827;
  --field-border: #35435c;
  --field-soft: #18212f;
  --hover: rgba(59, 130, 246, 0.12);
  --landing-bg: #0b1018;
  --error: #ff9a90;
  --error-bg: rgba(230, 90, 80, 0.16);
  --warn-bg: rgba(225, 155, 45, 0.16);
  --warn-ink: #e3a848;
  --footer-bg: #0a101b;
  --footer-link: #93b8fd;
  --hero-bg: linear-gradient(135deg, #1e3a8a 0%, #0f1a33 100%);
  --offer-bg: linear-gradient(135deg, #1d4ed8 0%, #16243a 100%);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --fresh-sky: radial-gradient(700px 360px at 90% -120px, rgba(251, 191, 36, 0.05), transparent 62%), radial-gradient(560px 320px at 0% -100px, rgba(59, 130, 246, 0.07), transparent 55%);
}


body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  width: 100%;
  background: var(--hero-bg);
  color: #fff;
  text-align: center;
  padding: 28px 20px 56px;
}

.hero .brand {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero .brand span {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* Uploaded logo: arbitrary shape, transparent PNG - no box, no crop */
.brand-logo {
  height: 56px;
  max-width: 220px;
  object-fit: contain;
  display: block;
}


.hero h1 { font-size: 26px; line-height: 1.3; }
.hero p { margin-top: 8px; font-size: 15px; opacity: 0.9; }

/* Live "⏳ Offer ends in 2d 5h" pill on promotion forms with an end date */
.countdown {
  display: inline-block;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px 20px;
  width: calc(100% - 32px);
  max-width: 420px;
  margin: -36px 16px 24px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input, .field textarea {
  width: 100%;
  font-size: 16px;
  padding: 13px 14px;
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--field-bg);
}

.field input:focus, .field textarea:focus { border-color: var(--teal); }
.field textarea { resize: vertical; min-height: 72px; font-family: inherit; }

.field .err { color: var(--error); font-size: 13px; margin-top: 5px; }

/* --- The phone box's country (static/js/phone-cc.js): the flag and dial
   code in front of the number, and the list of countries it opens below the
   box. The flags come from a font of their own: Windows draws none. --- */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("/static/vendor/flags/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF;
  font-display: swap;
}
.pcc-flag {
  font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 20px; line-height: 1; font-weight: 400;
}
.phone-row { display: flex; }
.pcc-btn {
  display: flex; align-items: center; gap: 6px; flex: none; padding: 0 9px 0 12px;
  border: 1.5px solid var(--field-border); border-right: 0; border-radius: 10px 0 0 10px;
  background: var(--field-soft); color: var(--ink); font: inherit; font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.pcc-btn:focus-visible, .pcc-btn[aria-expanded="true"] { outline: none; border-color: var(--teal); border-right: 1.5px solid var(--teal); }
.pcc-chev { width: 15px; height: 15px; color: var(--muted); flex: none; transition: transform .15s ease; }
.pcc-btn[aria-expanded="true"] .pcc-chev { transform: rotate(180deg); }
.field .phone-row input { flex: 1; min-width: 0; border-radius: 0 10px 10px 0; font-variant-numeric: tabular-nums; }
.pcc-panel {
  margin-top: 6px; background: var(--card); border: 1.5px solid var(--field-border);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.pcc-search { display: flex; align-items: center; gap: 8px; padding: 2px 12px; border-bottom: 1px solid var(--line); background: var(--field-soft); }
.pcc-search svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.pcc-panel .pcc-search input[type="search"] {
  flex: 1; min-width: 0; width: auto; padding: 11px 0; margin: 0;
  border: 0; border-radius: 0; background: transparent; font-size: 16px; color: var(--ink);
}
.pcc-list { list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pcc-opt { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.pcc-opt:hover, .pcc-opt.active { background: var(--hover); }
.pcc-opt[aria-selected="true"] { font-weight: 600; }
.pcc-opt .pcc-flag { font-size: 22px; }
.pcc-name { flex: 1; min-width: 0; color: var(--ink); }
.pcc-code { color: var(--muted); font-variant-numeric: tabular-nums; }
.pcc-tick { width: 17px; height: 17px; color: var(--teal-ink); flex: none; }
.pcc-sep {
  margin: 4px 6px 0; padding: 10px 4px 4px; border-top: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.pcc-none { padding: 12px 14px; font-size: 14px; color: var(--muted); margin: 0; }

/* --- Address region comboboxes (district / state) - see geo-select.js.
   Styled to sit on top of .field, so the plain inputs underneath look
   identical before the script upgrades them (or if it never does). --- */

.geo .field select {
  width: 100%;
  font-size: 16px;
  padding: 13px 14px;
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--field-soft);   /* country is display-only today */
}

.geo-wrap { position: relative; }

.geo-note { font-size: 12px; color: var(--muted); margin-top: 5px; }

.geo-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  background: var(--card);
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.geo-opt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  font-size: 15px;
  cursor: pointer;
}

/* Pointer hover and keyboard focus land on the same visual state, so the
   highlighted row always means the same thing. */
.geo-opt:hover, .geo-opt.active { background: var(--hover); }

/* The state a district belongs to - the disambiguator when a district name
   repeats across states, so it must stay legible, not decorative. */
.geo-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.geo-opt-other {
  border-top: 1px solid var(--field-border);
  color: var(--teal-ink);
  font-weight: 600;
}

/* PIN + country share a row on anything wider than a small phone. */
.geo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .geo-row { grid-template-columns: 1fr; gap: 0; } }
.form-err {
  background: var(--error-bg);
  color: var(--error);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Turnstile. :not(:empty) so a widget that never loaded (blocked script, weak
   signal) leaves no orphan gap above the button - that visitor still submits
   via the per-IP fallback. */
.cf-turnstile:not(:empty) { margin-bottom: 16px; }

.cta {
  position: relative;
  isolation: isolate;
  width: 100%;
  background: var(--btn-fill);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.trust {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 12px;
}

/* "*Terms & Conditions apply" line under the submit button */
.terms-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.terms-note a { color: var(--teal-ink); font-weight: 600; }

/* Full T&C page (/terms, /r|/p/{slug}/terms) */
.terms-card { max-width: 640px; padding-bottom: 24px; }

.terms-body {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.terms-back {
  display: inline-block;
  margin-top: 18px;
  color: var(--teal-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

/* The EXPL TEAMS app's privacy policy (/app/privacy) */
.privacy-body { color: var(--ink); font-size: 14px; line-height: 1.65; overflow-wrap: break-word; }
.privacy-body h2 { font-size: 16px; margin: 22px 0 6px; }
.privacy-body p { margin: 0 0 10px; }
.privacy-body ul { margin: 0 0 10px; padding-left: 20px; }
.privacy-body li { margin-bottom: 8px; }
.privacy-body a { color: var(--teal-ink); font-weight: 600; }

/* Success screen: same brand hero as the form, card overlaps the gradient */
.success-hero { padding: 34px 20px 72px; }

.success-hero .brand { margin-bottom: 0; }

.success-card { text-align: center; padding: 34px 24px 28px; }

.success-card h1 { font-size: 23px; line-height: 1.3; margin-bottom: 10px; }
.success-card p { color: var(--muted); font-size: 15px; line-height: 1.55; }

/* Coupon code issued to a promotion lead - big and screenshot-friendly */
.coupon {
  margin-top: 20px;
  border: 1.5px dashed var(--teal);
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  padding: 14px 16px;
}

.coupon-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.coupon-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--teal-ink);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.coupon-hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.success-divider {
  height: 1px;
  background: var(--line);
  margin: 22px auto 14px;
  width: 72%;
}

.success-card .success-note { font-size: 13px; }

.checkmark {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--teal);
  margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.checkmark svg { width: 44px; height: 44px; }

.checkmark path {
  stroke: #fff; stroke-width: 6; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw 0.5s 0.25s ease forwards;
}

@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* --- "Offer ended" interstitial --- */

.ended-icon { font-size: 56px; margin-bottom: 14px; }
.ended-link { color: var(--teal-ink); font-weight: 600; }

/* --- Landing page (ISP marketing) --- */

body.landing { background: var(--landing-bg); }

.landing-hero { padding: 36px 20px 44px; }

.landing-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.landing-hero h1 { font-size: 30px; max-width: 640px; margin: 0 auto; }
.landing-hero p { max-width: 560px; margin: 10px auto 0; font-size: 15.5px; }

.landing-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.landing-cta {
  display: inline-block;
  width: auto;
  padding: 13px 26px;
  border-radius: 12px;
  text-decoration: none;
  background: #fff;
  color: #1e3a8a;
}

.landing-cta.ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.landing-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: calc(100% - 32px);
  max-width: 860px;
  margin: -26px auto 8px;
}

.landing-stat {
  flex: 1 1 150px;
  max-width: 210px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: center;
  padding: 18px 12px;
}

.landing-stat .value { font-size: 24px; font-weight: 800; color: var(--teal-ink); }
.landing-stat .label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.landing-section {
  width: calc(100% - 32px);
  max-width: 860px;
  margin: 30px auto 0;
}

.landing-section h2 {
  font-size: 21px;
  text-align: center;
  margin-bottom: 18px;
}

/* Enquiry form: .card styling, but centered in its section instead of
   overlapping the hero */
.landing-form { margin: 0 auto; width: 100%; max-width: 440px; }

.landing-form-note {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  margin-bottom: 16px;
}

.offer-strip { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.offer-card {
  flex: 1 1 240px;
  max-width: 320px;
  background: var(--offer-bg);
  color: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 6px 20px rgba(16, 34, 64, 0.18);
}

.offer-headline { font-size: 18px; font-weight: 800; line-height: 1.3; }
.offer-subtext { font-size: 13.5px; opacity: 0.9; margin-top: 6px; }

.offer-call {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  padding-bottom: 1px;
}

/* "*T&C apply" link on a landing offer card (white-on-gradient) */
.offer-terms {
  display: inline-block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 1px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.service-card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
}

.service-icon { font-size: 30px; }
.service-title { font-size: 16px; font-weight: 700; margin-top: 10px; }
.service-text { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.poster {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  display: block;
}

.landing-footer {
  width: 100%;
  margin-top: 40px;
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 28px 20px 34px;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-footer .footer-brand { font-size: 17px; font-weight: 800; color: #fff; }
.landing-footer a { color: var(--footer-link); text-decoration: none; font-weight: 600; }

/* --- Lead-form posters -----------------------------------------------------
   One uploaded set, two layouts: a horizontal swipe carousel below the form on
   phones, left/right rails flanking the form on desktop. `display:contents`
   reshapes the same DOM at the breakpoint, so no image is ever loaded twice. */

/* With no posters, .scan-layout is just the centered card - identical to the
   old body layout. The rails/carousel below apply only when posters exist. */
.scan-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mobile: the two rails collapse (display:contents) so all their images become
   direct children of this one horizontal scroller - a single carousel. */
.posters-wrap {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 4px 16px 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.posters-wrap::-webkit-scrollbar { display: none; }

.poster-rail { display: contents; }

.poster-img {
  flex: 0 0 78%;
  max-width: 300px;
  scroll-snap-align: center;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(16, 34, 64, 0.16);
  object-fit: cover;
}

/* Desktop: a three-column grid places the two rails on either side of the
   card. The card keeps its negative top margin so it still overlaps the hero. */
@media (min-width: 1000px) {
  .scan-layout.has-posters {
    display: grid;
    grid-template-columns: 1fr minmax(0, 460px) 1fr;
    grid-template-areas: "left card right";
    align-items: start;
    justify-content: center;
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
  }
  .scan-layout.has-posters .card { grid-area: card; }

  /* Unwrap the carousel so its rails become the side grid items. */
  .scan-layout.has-posters .posters-wrap {
    display: contents;
    overflow: visible;
  }
  .scan-layout.has-posters .poster-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 8px;
  }
  .scan-layout.has-posters .rail-left { grid-area: left; align-items: flex-end; }
  .scan-layout.has-posters .rail-right { grid-area: right; align-items: flex-start; }

  .scan-layout.has-posters .poster-img {
    flex: none;
    width: 100%;
    max-width: 240px;
  }
}


/* Staff preview of a form (admin.preview_*): unmissable, so nobody mistakes
   it for the live page. */
.preview-bar {
  background: var(--warn-bg); color: var(--warn-ink); text-align: center;
  font-size: 13.5px; font-weight: 600; padding: 10px 16px; line-height: 1.5;
}


/* The address block (public/_address.html): three routes to a location, and
   the map and typed fields behind whichever one the customer picks. */
.addr {
  margin: 4px 0 18px; padding: 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--field-soft);
}
/* These groups are shown and hidden by the script; several of them are grids
   or flex rows, which would otherwise outrank the hidden attribute. */
.addr [hidden] { display: none !important; }
.addr-head { margin-bottom: 12px; }
.addr-label { display: block; font-size: 15px; font-weight: 700; }
.addr-label .opt { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.addr-help { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 3px; }

/* The three routes. One tall primary, two quieter ones under it: the fastest
   way through this form should be the one the eye lands on. */
.addr-routes { display: grid; gap: 8px; }
.addr-route {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--field-border); background: var(--card); color: var(--ink);
  font: inherit; transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.addr-route:active { transform: translateY(1px); }
.addr-route:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.addr-route.is-primary {
  position: relative; isolation: isolate;
  background: var(--btn-fill); border-color: transparent; color: #fff;
  box-shadow: var(--shadow-sm);
}
.addr-route-ic { font-size: 21px; line-height: 1; flex: none; }
.addr-route-tx { display: grid; gap: 1px; min-width: 0; }
.addr-route-tx b { font-size: 15px; font-weight: 700; }
.addr-route-tx small { font-size: 12.5px; opacity: 0.75; }
@media (min-width: 560px) {
  /* Room for the two secondary routes to sit side by side under the primary. */
  .addr-routes { grid-template-columns: 1fr 1fr; }
  .addr-route.is-primary { grid-column: 1 / -1; }
}

/* The settled location: what we think we know, and the way back. */
.addr-found {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px;
  border-radius: 12px; border: 1.5px solid var(--teal); background: var(--hover);
}
.addr-found-ic {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--teal);
  color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
.addr-found-tx { display: grid; gap: 2px; min-width: 0; flex: 1; }
.addr-found-tx b { font-size: 15px; line-height: 1.35; }
.addr-found-tx small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.addr-relink {
  flex: none; background: none; border: 0; padding: 2px 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--teal-ink);
  text-decoration: underline;
}
.addr-relink:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.addr-back {
  background: none; border: 0; padding: 0 0 10px; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.addr-back:hover { color: var(--teal-ink); }
.addr-back:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.addr-pick { margin-top: 2px; }
.addr-manual { margin-top: 14px; }
.addr-manual:first-child { margin-top: 0; }
/* The last field in the block carries the card's padding, not its own. */
.addr-manual > .field:last-child { margin-bottom: 0; }
.addr-edit-region {
  background: none; border: 0; padding: 4px 0 0; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--teal-ink); text-decoration: underline;
}
.addr-edit-region:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.pin-search { position: relative; }
.pin-search input {
  width: 100%; font-size: 16px; padding: 12px 14px; color: var(--ink);
  border: 1.5px solid var(--field-border); border-radius: 10px; background: var(--field-bg);
}
.pin-search input:focus { outline: none; border-color: var(--teal); }
.pin-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  list-style: none; background: var(--card); border: 1px solid var(--field-border);
  border-radius: 10px; box-shadow: var(--shadow);
  max-height: 290px; overflow-y: auto;
}
.pin-opt { display: grid; gap: 2px; padding: 10px 12px; cursor: pointer; border-top: 1px solid var(--line); }
.pin-opt:first-child { border-top: 0; }
.pin-opt b { font-size: 15px; }
.pin-opt span { font-size: 12.5px; color: var(--muted); }
.pin-opt em { font-style: normal; font-size: 11.5px; color: var(--warn-ink); }
.pin-opt.active, .pin-opt:hover { background: var(--hover); }
.pin-none { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.pin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pin-btn {
  background: var(--card); color: var(--ink); border: 1.5px solid var(--field-border);
  border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.pin-btn:disabled { opacity: 0.6; }
.pin-why { font-size: 12px; color: var(--muted); margin-top: 8px; }
.pin-map {
  margin-top: 10px; height: 260px; max-width: 100%; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--field-border); background: var(--card);
}
/* No min-height: empty, this must take no room at all, or every block carries
   a blank line under the routes. */
.pin-where:not(:empty) { margin-top: 8px; font-size: 13.5px; line-height: 1.45; }
.pin-where.pin-err { color: var(--error); font-weight: 600; }

/* ---------- Appearance: light / dark / system ---------- */
/* A visitor's page, so the control is a quiet glass pill in the corner of the
   brand header - present for anyone who wants it, in nobody's way. */
.theme-float {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  z-index: 30;
}
body { position: relative; }

.theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  /* Dark glass rather than light: the corner sits on the brand gradient on
     most pages and on the staff preview bar on one, and this reads on both. */
  background: rgba(10, 24, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.theme-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-opt svg { width: 16px; height: 16px; }
.theme-switch.compact .theme-opt span { display: none; }
.theme-opt:hover { color: #fff; }
.theme-opt[aria-pressed="true"] { background: rgba(255, 255, 255, 0.28); color: #fff; }
.theme-opt:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }


/* MapLibre draws its own controls and attribution with a white chrome of its
   own; these follow the theme instead. The icons inside the buttons are
   background images, so they are inverted rather than recoloured. */
.maplibregl-ctrl-group {
  background: var(--map-ctrl-bg) !important;
  box-shadow: 0 0 0 1px var(--map-ctrl-line) !important;
}
.maplibregl-ctrl-group button + button { border-top-color: var(--map-ctrl-line) !important; }
.maplibregl-ctrl-group button:hover { background: var(--map-ctrl-hover) !important; }
.maplibregl-ctrl-group button span { filter: var(--map-ctrl-filter); }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib a {
  background: var(--map-ctrl-bg) !important;
  color: var(--ink) !important;
}
.maplibregl-ctrl-attrib-button { filter: var(--map-ctrl-filter); }

/* The light/dark switch each map carries (static/js/map-flavor.js). MapLibre
   draws its own control icons as background images and --map-ctrl-filter
   inverts the lot in dark mode; this icon is an SVG stroked in the text
   colour instead, so it must not be caught by that and is not a <span>. */
.map-flavor-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.map-flavor-btn svg { width: 17px; height: 17px; }
.maplibregl-popup-content {
  background: var(--map-ctrl-bg) !important;
  color: var(--ink) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}
.maplibregl-popup-tip { border-top-color: var(--map-ctrl-bg) !important; border-bottom-color: var(--map-ctrl-bg) !important; }

/* ---------- On demand QR code forms ---------- */
.field .opt { font-weight: 400; color: var(--muted); }
.field .help { font-size: 12.5px; color: var(--muted); margin: -3px 0 7px; line-height: 1.45; }
.field select {
  width: 100%; border: 1.5px solid var(--field-border); border-radius: 10px; padding: 12px 40px 12px 14px;
  font-size: 16px; color: var(--ink); background: var(--field-bg) no-repeat right 14px center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%237a8798' stroke-width='2' stroke-linecap='round'/></svg>");
  appearance: none; -webkit-appearance: none;
}
.field select:focus { outline: none; border-color: var(--teal); }
.field.has-err input, .field.has-err textarea, .field.has-err select { border-color: var(--error); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt { position: relative; }
.chip-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-opt span {
  display: inline-block; border: 1.5px solid var(--field-border); border-radius: 999px; padding: 9px 15px;
  font-size: 14.5px; font-weight: 600; color: var(--ink); background: var(--field-bg); cursor: pointer;
  user-select: none;
}
.chip-opt input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip-opt input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn { position: relative; }
.yn input { position: absolute; opacity: 0; width: 0; height: 0; }
.yn span {
  display: block; text-align: center; border: 1.5px solid var(--field-border); border-radius: 12px; padding: 13px;
  font-size: 16px; font-weight: 700; color: var(--ink); background: var(--field-bg); cursor: pointer;
}
.yn input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.rating { display: flex; gap: 4px; }
.star { position: relative; }
.star input { position: absolute; opacity: 0; width: 0; height: 0; }
.star span { font-size: 34px; line-height: 1; color: var(--field-border); cursor: pointer; }
.rating:has(input:checked) .star span { color: #f2b01e; }
.star input:checked ~ span, .star:has(input:checked) ~ .star span { color: var(--field-border); }
.rating:has(input:checked) .star:has(input:checked) span { color: #f2b01e; }
.file-drop {
  display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--field-border); border-radius: 12px;
  padding: 14px; cursor: pointer; background: var(--field-soft);
}
.file-drop input { position: absolute; opacity: 0; width: 0; height: 0; }
.file-drop .file-icon { font-size: 24px; }
.file-drop .file-text { display: grid; min-width: 0; }
.file-drop .file-text b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop .file-text small { font-size: 12.5px; color: var(--muted); }
.file-drop.chosen { border-style: solid; border-color: var(--teal); background: var(--hover); }
.file-drop.too-big { border-color: var(--error); background: var(--error-bg); }
.field.consent { margin-top: 4px; }
.consent-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.consent-row input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--teal); }
.consent-row .req { color: var(--error); font-style: normal; }
.consent-row small { display: block; color: var(--muted); font-size: 12.5px; }
.cta-link { display: block; text-align: center; text-decoration: none; margin-top: 18px; }

/* The moment before a redirect code's phone goes on. */
body.hop { min-height: 100vh; display: grid; place-items: center; background: var(--hero-bg); padding: 20px; }
.hop-card {
  background: var(--card); border-radius: 18px; padding: 34px 28px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: var(--shadow);
}
.hop-logo { max-height: 48px; max-width: 180px; object-fit: contain; margin-bottom: 14px; }
.hop-brand { font-size: 22px; font-weight: 800; color: var(--ink); margin-bottom: 14px; }
.hop-card h1 { font-size: 19px; line-height: 1.3; margin-bottom: 8px; }
.hop-card p { color: var(--muted); font-size: 14.5px; }
.hop-spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--teal);
  margin: 0 auto 16px; animation: hop-spin 0.8s linear infinite;
}
@keyframes hop-spin { to { transform: rotate(360deg); } }
.hop-link { display: inline-block; margin-top: 18px; color: var(--teal-ink); font-weight: 600; font-size: 13.5px; }
.preview-bar + .hop-card { margin-top: 12px; }

/* The staff address's front page offers both phone apps - the sales exec app
   and the field activity app - so whoever arrives finds their own door
   without being told a second address. Two calls to action stacked, the
   second quieter, because most people who reach this page want the first. */
.staff-doors { display: grid; gap: 10px; text-align: center; }
.staff-doors .cta { display: block; text-decoration: none; }
.staff-doors .cta.ghost {
  background: var(--card);
  color: var(--teal-ink);
  border: 1px solid var(--line);
}
.staff-doors .trust { margin-top: 2px; }

/* ---------- The fresh morning finish ----------
   The same as the panel and the phone apps: morning light behind the page,
   and every button turning inside out under the pointer. A solid one goes
   white with its fill as the text; an outlined one fills with the brand. A
   gradient cannot be transitioned, so a solid button's white is a layer under
   the text that fades in, and its outline is drawn on that layer (the layer
   paints over the button's own edge). A phone has no hover and keeps :hover
   stuck after a tap, so there the flip is :active only - it shows while the
   thumb is down and lets go with it. The text on the white is a literal
   deep blue: it always sits on white, whichever theme the page is in. */
body {
  background-image: var(--fresh-sky);
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.cta::before, .addr-route.is-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--teal);
  opacity: 0; transition: opacity 0.2s ease;
}
.cta:not(.ghost):not(:disabled):active,
.addr-route.is-primary:active { color: #1d4ed8; }
.cta:not(.ghost):not(:disabled):active::before,
.addr-route.is-primary:active::before { opacity: 1; }
.addr-route:not(.is-primary):active,
.pin-btn:not(:disabled):active,
.staff-doors .cta.ghost:active {
  background: var(--teal); border-color: var(--teal); color: #fff;
}
@media (hover: hover) {
  .cta:not(.ghost):not(:disabled):hover, .cta:not(.ghost):focus-visible,
  .addr-route.is-primary:hover, .addr-route.is-primary:focus-visible {
    color: #1d4ed8; transform: translateY(-1px);
    box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.6);
  }
  .cta:not(.ghost):not(:disabled):hover::before, .cta:not(.ghost):focus-visible::before,
  .addr-route.is-primary:hover::before, .addr-route.is-primary:focus-visible::before { opacity: 1; }
  .addr-route:not(.is-primary):hover,
  .pin-btn:not(:disabled):hover,
  .staff-doors .cta.ghost:hover {
    background: var(--teal); border-color: var(--teal); color: #fff;
    transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.6);
  }
}

/* "Other" opens a box to say what it is (static/js/other-box.js). */
.field .other-box { margin-top: 10px; }
