/* ==========================================================================
   Leading Edge stylesheet: split-screen layout
   Left: fixed photo panel (headline, fee). Right: navigation, page content, footer.

   Colour scheme: set data-theme on <html> in templates/main/base.html
     data-theme="a"  Leading Edge navy & orange (live)
     data-theme="d"  Slate & Coral (spare)

   Breakpoint: max-width 860px stacks the panels (phones and small tablets).
   ========================================================================== */


/* ---------- Colour schemes ---------- */

:root,
[data-theme="a"] {
  /* Leading Edge brand (logo/final/brand-guide.html): navy #0B2545, orange #F25C3B, blue #13A8E0 */
  --page: #f8f9fb;
  --surface: #ffffff;
  --text: #0b2545;          /* brand navy */
  --muted: #55657a;
  --border: #dfe4ea;
  --field: #f7f9fb;
  --dark: #0b2545;          /* brand navy */
  --on-dark: #ffffff;
  --on-dark-muted: #b4c0cf;
  --accent: #f25c3b;        /* brand orange */
  --accent-hover: #f47a5e;  /* lighter on hover, so the navy button text stays readable (5.7:1) */
  --on-accent: #0b2545;     /* navy text on orange buttons (4.7:1; white would only be 3.3:1) */
  --accent-soft: #fdeae5;
  --accent-strong: #d9431f; /* darker orange for icons and focus rings on light backgrounds (3:1+) */
  --highlight: #13a8e0;     /* brand blue: the second stripe */
  --field-border: #7c8797;  /* outlines of inputs and choices (3:1+ on every light background) */
  --error: #c2410c;
  --success: #16a34a;
}

[data-theme="d"] {
  --page: #faf9f7;
  --surface: #ffffff;
  --text: #1d2433;
  --muted: #626a78;
  --border: #e6e2dc;
  --field: #fbfaf8;
  --dark: #1e293b;
  --on-dark: #ffffff;
  --on-dark-muted: #c2cad6;
  --accent: #f26b4f;
  --accent-hover: #f47f66;  /* lighter on hover (was #dc5639), to keep dark text readable: 6.0:1 */
  --on-accent: #1d2433;     /* dark button text (was white, only 3:1 on coral): 5.2:1 (2026-11-08) */
  --accent-soft: #fde8e3;
  --accent-strong: #c9432a;
  --field-border: #8a8378;
  --error: #b91c1c;
  --success: #16a34a;
}


/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1,
h2,
h3,
.headline,
.section-title {
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 22px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
}


/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 46% 54%;
  min-height: 100vh;
}


/* ---------- Left photo panel ---------- */

.left {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 44px;
  background: var(--dark);
  color: var(--on-dark);
}

.left .bg {
  position: absolute;
  inset: 0;
  z-index: 0; /* photo at the bottom, shading above it, text on top */
}

/* The photo is a <picture> (WebP with a JPEG fallback); the <img> fills it */
.left .bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Darken the photo top and bottom so the logo and headline stay readable */
.left::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .15) 50%, var(--dark) 92%);
}

.left > :not(.bg) {
  position: relative;
  z-index: 1;
}

.left .logo {
  height: 68px; /* 57px + 20% (was 38px + 50%) */
  width: auto;
  align-self: flex-start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.left .headline {
  margin: 0;
  font-size: 76px;
  font-weight: 800;
  font-style: italic;
  line-height: .98;
  letter-spacing: -.02em;
}

.left .tagline {
  margin: 12px 0 22px;
  font-size: 24px;
  font-weight: 600;
}

.fee-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fee-row .fee {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 22px;
  font-weight: 800;
}

.fee-row .fee-detail {
  color: var(--on-dark-muted);
  font-size: 15px;
}


/* ---------- Right column: navigation, content, footer ---------- */

.right {
  display: flex;
  flex-direction: column;
  padding: 0 64px 0 56px;
}

/* The menu sits on a white bar across the whole right column (the
   negative margins cancel .right's padding), with a soft shadow, so it
   reads as a header rather than a line of text. */
.site-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 80px;
  margin: 0 -64px 0 -56px;
  padding: 0 64px 0 56px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(11, 27, 46, .06);
  font-weight: 500;
}

.site-nav a {
  padding: 8px 2px;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* Current page: bold, with an orange underline */
.site-nav a[aria-current="page"] {
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--accent-strong);
}

.site-nav .btn {
  margin-left: auto;
  padding: 13px 22px; /* undo the link padding above */
  color: var(--on-accent);
}

.content {
  flex: 1;
  padding-bottom: 48px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  text-decoration: none;
}

.section-title {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.15;
}

.section-lead {
  margin: 0 0 24px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
}


/* ---------- Home: intro ---------- */

.intro {
  padding: 40px 0 36px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
}

.intro .big {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.intro p,
.intro h1.big { /* the home page's main heading: looks like the paragraph it replaced */
  color: var(--muted);
}


/* ---------- Home: service request form ---------- */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  margin-bottom: 16px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--field);
  color: var(--text);
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
  font: inherit;
  font-size: 16px; /* 16px stops iPhones zooming in on tap */
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-strong);
  outline: 3px solid var(--accent-soft);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error);
}

.errorlist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
}

.form-errors .errorlist {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fef2f2;
  border-radius: 10px;
}

/* Upload area: one box for up to 5 files (main/_upload.html, js/main.js) */
.upload {
  margin-bottom: 18px;
  padding: 18px;
  background: var(--field);
  border: 2px dashed var(--field-border);
  border-radius: 12px;
  text-align: center;
}

.upload-title {
  margin: 0;
  font-weight: 600;
}

.upload-title span,
.upload-hint {
  color: var(--muted);
  font-weight: 400;
}

.upload-hint {
  margin: 2px 0 14px;
  font-size: 14px;
}

/* The tap/click/drop target: big enough for a thumb on a phone */
.upload-drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.upload-drop i {
  font-size: 20px;
  color: var(--accent-strong);
}

.upload-drop strong {
  color: var(--text);
  font-weight: 600;
}

.upload-drop:hover,
.upload-drop.dragging {
  border-color: var(--accent-strong);
  color: var(--text);
}

.upload-drop.dragging {
  background: var(--accent-soft);
}

.upload-drop:focus-within {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

.no-drag .upload-drag {
  display: none;
}

/* The real file input: hidden visually but still reachable with the keyboard */
.upload-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Chosen files, one per row: name, size, remove */
.upload-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.upload-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 6px;
  padding: 6px 6px 6px 12px;
  background: var(--surface);
  border: 1.5px solid var(--success);
  border-radius: 10px;
  font-size: 14px;
}

.upload-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-size {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.upload-remove {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.upload-remove:hover {
  background: var(--field);
  color: var(--error);
}

.upload-remove:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 0;
}

.upload-problem {
  margin: 10px 0 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
}

.has-problem .upload-list li:nth-child(n+6) {
  border-color: var(--error);
}

.submit {
  width: 100%;
  padding: 15px;
  font-size: 16px;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}


/* ---------- Steps, fee box and small print (maintenance pages; class names from the old second opinion page) ---------- */

.opinion-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 44px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.opinion-steps li {
  counter-increment: step;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 15px;
}

.opinion-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 50%;
  font-weight: 700;
}

.opinion-steps strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}


.opinion-fee {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
  padding: 16px 20px;
  background: var(--accent-soft);
  border-radius: 12px;
}

.opinion-fee .amount {
  font-size: 30px;
  font-weight: 800;
}


.opinion-small {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .opinion-steps {
    grid-template-columns: 1fr;
  }
}


/* ---------- Thanks page ---------- */

.thanks {
  margin-top: 40px;
  padding: 56px 28px;
  text-align: center;
}

.thanks-tick {
  font-size: 88px;
  color: var(--success);
}

.thanks h2 {
  margin: 18px 0 6px;
  font-size: 34px;
}

.thanks p {
  margin: 0 0 6px;
  color: var(--muted);
}

.thanks .btn {
  margin-top: 22px;
}


/* ---------- FAQ page ---------- */

.faq {
  padding-top: 40px;
}

.faq h3 {
  margin: 32px 0 12px;
  font-size: 20px;
}

.faq a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.faq details {
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.faq details[open] {
  border-color: var(--accent);
}

.faq summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
}

.faq summary::marker {
  color: var(--accent-strong);
}

.faq details p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
}

/* Privacy page: plain paragraphs and lists in the FAQ layout */
.privacy p,
.privacy li {
  color: var(--muted);
}

.privacy ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.privacy li {
  margin-bottom: 8px;
}


/* ---------- Installers page ---------- */

.installers {
  padding-top: 40px;
}

.installer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.installer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
}

.installer-logo {
  height: 32px;
  width: auto;
  align-self: flex-start;
  margin-bottom: 10px;
}

.installer h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.installer a {
  color: var(--muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.installer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.installer i {
  width: 18px;
  color: var(--accent-strong);
}


/* ---------- Reviews page ---------- */

.reviews {
  padding-top: 40px;
}

.sample-warning {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1.5px solid var(--error);
  border-radius: 12px;
  color: var(--text);
}

.sample-warning i {
  margin-top: 3px;
  color: var(--error);
}

.review-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  margin-bottom: 20px;
}

.review-score {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.review-average {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
}

.review-count {
  color: var(--muted);
  font-size: 14px;
}

.review-google {
  flex: 1;
  min-width: 240px;
}

.review-google p {
  margin: 0 0 12px;
  color: var(--muted);
}

.review-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
}

.btn-outline:hover {
  background: var(--text);
  color: var(--surface);
}

.review-stars {
  color: var(--accent-strong);
  letter-spacing: 2px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.review {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

.review blockquote {
  flex: 1;
  margin: 0;
  line-height: 1.55;
}

.review footer span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.review-cta {
  margin: 28px 0 0;
  color: var(--muted);
}

.review-cta a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}


/* ---------- Maintenance list pages ---------- */

.cooldown-note {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
}

.cooldown-note i {
  margin-top: 4px;
  color: var(--accent-strong);
}

.cooldown-note a {
  color: var(--text);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.thanks form {
  margin-top: 22px;
}

.maintenance-answer {
  padding-top: 40px;
}

.details-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0 0 8px;
}

.details-list dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.details-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.details-note {
  margin: 0 0 16px;
  text-align: left;
}

.maintenance-no {
  margin-top: 16px;
}


/* ---------- Phones and small tablets: stack the panels ---------- */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  /* Stronger shading so the headline and fee stay readable over the photo */
  .left::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, .4) 0%, rgba(0, 0, 0, .1) 25%, rgba(0, 0, 0, .55) 55%, var(--dark) 88%);
  }

  .left {
    position: relative;
    height: 360px;
    padding: 22px 22px 26px;
  }

  /* The logo is about 300px wide: on the narrowest phones, shrink it to fit */
  .left .logo {
    max-width: 100%;
    height: auto;
    max-height: 68px;
  }

  .left .headline {
    font-size: 46px;
  }

  .left .tagline {
    margin: 8px 0 14px;
    font-size: 19px;
  }

  /* The home page gets a taller photo panel */
  .page-home .left {
    height: 600px;
  }

  .page-home .left .headline {
    font-size: 54px;
  }

  .right {
    padding: 0 20px;
  }

  .site-nav {
    height: auto;
    margin: 0 -20px;
    padding: 14px 20px;
    gap: 8px 20px;
    flex-wrap: wrap;
  }

  .site-nav .btn {
    display: none;
  }

  .intro {
    padding-top: 16px;
  }

  .intro .big {
    font-size: 21px;
  }

  .section-title {
    font-size: 28px;
  }

  .card {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .faq,
  .installers {
    padding-top: 16px;
  }
}


/* ---------- Phone booking button (base.html, js/mobile-book.js) ---------- */

.mobile-book {
  display: none;
}

@media (max-width: 860px) {
  .mobile-book {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 50;
    text-align: center;
    box-shadow: 0 8px 24px rgba(11, 27, 46, .25);
    transition: opacity .2s ease, transform .2s ease;
  }

  .mobile-book.is-hidden {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
  }

  /* Room at the bottom so the button never covers the footer */
  body:has(.mobile-book) .site-footer {
    padding-bottom: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-book {
    transition: none;
  }
}


/* ---------- Home: pricing promise and ARCtick badge ---------- */

.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 22px;
}

/* The promise can shrink to 200px so it sits beside the ARCtick badge
   on laptop-sized screens (right column from about 560px wide); on
   narrower screens the badge drops underneath. */
.intro .promise {
  display: flex;
  gap: 10px;
  flex: 1 1 200px;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.promise i {
  margin-top: 3px;
  color: var(--accent-strong);
}

.arctick {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.arctick img {
  height: 36px;
  width: auto;
}

.arctick span {
  color: var(--muted);
}

.arctick strong {
  display: block;
  color: var(--text);
}


/* ---------- Thanks page: next-step suggestion ---------- */

.upsell {
  margin-top: 20px;
  padding: 26px 28px;
  text-align: center;
}

.upsell h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.upsell p {
  margin: 0 0 16px;
  color: var(--muted);
}

