:root {
  --content-max-width: 840px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #eef2f5;
  margin: 0;
  padding: 0;
}

.container > .card:first-of-type {
  margin-top: 8px;
}

.container {
  max-width: var(--content-max-width);
  margin: auto;
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--content-max-width);
  }
}

/* ============================
   PAGE WRAP (CONTENT GUTTER)
   ============================ */

.page-wrap {
  background: #f5f7fa;
  padding: 24px 0 40px;
  border-top: 1px solid #e1e6ed;
}

body.no-scroll {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

.card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
  border: 1px solid #e3e7ee;
  margin-bottom: 32px;

  box-sizing: border-box;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Subtle separation between action and outcome */
#resultsCard {
  margin-top: 16px;
}


/* Mobile: internal comfort */
@media (max-width: 480px) {
  .card {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Mobile: distance from screen edge */
@media (max-width: 640px) {
  .card {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* Mobile: full-width results card without touching form layout */
@media (max-width: 640px) {
  #resultsCard {
    max-width: none;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ============================
   TABLET TUNING (iPad / small tablets)
   ============================ */

@media (min-width: 641px) and (max-width: 900px) {

  .hero {
    padding: 32px 0 24px;
  }

  .hero h1 {
    font-size: 2rem;          /* slightly calmer than desktop */
  }

  .hero .intro-text {
    max-width: 680px;         /* better line length for tablet */
  }

  .card {
    max-width: var(--content-max-width);
  }
}

.postcode-notice {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid #ccc;
  font-size: 0.95rem;
}

.step .postcode-notice {
  color: #444;
}

.postcode-notice.hidden {
  display: none;
}

.hidden { display: none; }

.step {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.dim-step {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.dim-step.hidden {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.dim-step:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.step.hidden {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.step:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}


h1, h2, h3 {
  margin-top: 0;
  color: #222;
}

label {
  font-weight: 600;
  margin-top: 12px;
  display: block;
}

input, select {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

input,
select,
textarea {
  box-sizing: border-box;
}

.input-group legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.input-group input[type="radio"] {
  transform: scale(1.2);
}

.helper-text {
  font-size: 0.9rem;
  color: #666;
}

.proposal-help {
  background: #f4f7fb;
  border: 1px solid #e2e8f3;
  border-left: 3px solid #9db0cf;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 6px 0 12px;
  font-size: 0.9rem;
  color: #394150;
  line-height: 1.4;
}

.proposal-help p:first-child {
  font-weight: 600;
  color: #2f3b4a;
}

.proposal-help p {
  margin: 0 0 0.4rem;
}

.proposal-help p:last-child {
  margin-bottom: 0;
}

.proposal-help ul {
  margin: 0 0 0.4rem 1.1rem;
  padding: 0;
}

.proposal-help li {
  margin-bottom: 0.25rem;
}

@media (max-width: 480px) {
  .proposal-help {
    padding: 9px 10px;
  }
}

.outcome-fixed {
  background: #f4f7fb;
  border: 1px solid #dbe4f2;
  border-left: 4px solid #0c2d57;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 0.95rem;
  color: #2f3b4a;
  line-height: 1.4;
}

button {
  width: 100%;
  padding: 14px;
  background: #0c2d57;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}

button:hover {
  background: #0a2445;
  cursor: pointer;
}

/* ============================
   CUSTOM SELECTS ON TOUCH DEVICES
   ============================ */
body.custom-selects select.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

button.custom-select-button {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #ffffff;
  color: #222;
  text-align: left;
  font-weight: 400;
}

button.custom-select-button:hover {
  background: #f6f8fa;
  cursor: pointer;
}

button.custom-select-button.is-disabled,
button.custom-select-button.is-disabled:hover {
  background: #f2f2f2;
  color: #777;
  cursor: not-allowed;
}

.custom-select-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.custom-select-modal.is-open {
  display: block;
}

.custom-select-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.custom-select-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.custom-select-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e6e6e6;
}

.custom-select-title {
  font-weight: 600;
  color: #222;
}

button.custom-select-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 22px;
  border: none;
  background: none;
  color: #667085;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

button.custom-select-close:hover {
  background: none;
  color: #475467;
}

.custom-select-options {
  padding: 12px 16px 20px;
  overflow-y: auto;
}

button.custom-select-option {
  width: 100%;
  padding: 12px;
  margin: 0 0 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #ffffff;
  color: #222;
  text-align: left;
  font-weight: 400;
}

button.custom-select-option:hover {
  background: #f6f8fa;
}

button.custom-select-option.is-selected {
  border-color: #0c2d57;
  background: #f2f6fb;
  font-weight: 600;
}

.pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  margin-bottom: 16px;
}

.pill.green { background: #4caf50; }
.pill.amber { background: #dca314; }
.pill.red { background: #c4473a; }

/* =========================================
   MOBILE-FIRST DIMENSION INPUT OVERRIDES
   (safe overrides – do not regress behaviour)
   ========================================= */

/* Prevent iOS zoom (Chrome/Safari iOS) */
input,
select,
textarea {
  font-size: 16px;
}

/* Make dimension groups feel lighter */
.input-group {
  margin-bottom: 1rem;
  padding: 0;
  border: none;
}

/* Legend: smaller, calmer */
.input-group legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

/* Radio option rows – MOBILE FIRST */
.input-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;

  padding: 0.55rem 0.65rem;
  margin-bottom: 0.4rem;

  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;

  cursor: pointer;

  /* CRITICAL: prevent text overflow on iPhone */
  justify-content: flex-start;
}

/* Hover (desktop only effect) */
.input-group label:hover {
  background: #f6f8fa;
}

/* Radio control – subtle */
.input-group input[type="radio"] {
  margin: 0;
  transform: scale(1.05);
  flex-shrink: 0;
}

.input-group label:active {
  transform: scale(0.99);
}

/* Text next to radio */
.option-text {
  font-size: 0.95rem;
  line-height: 1.3;
  color: #222;
}

/* Selected state – clear but calm */
.input-group label:has(input[type="radio"]:checked) {
  border-color: #0c2d57;
  background: #f2f6fb;
}

.input-group input[type="radio"]:checked + .option-text {
  font-weight: 600;
}

/* Helper text – de-emphasised */
.helper-text {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Tablet / desktop refinement */
@media (min-width: 768px) {
  .input-group label {
    padding: 0.45rem 0.6rem;
  }

  .option-text {
    font-size: 0.9rem;
  }
}

/* ============================
   FIX RADIO INPUT REGRESSION
   ============================ */

/* Radios must NOT inherit generic input styles */
input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0;
  border: none;
}

@media (prefers-reduced-motion: reduce) {
  .step,
  .dim-step {
    transition: none;
  }
}

#postcodeNotice {
  color: #444 !important;
}

/* ============================
   TITLE BAND (HEADER + H1)
   ============================ */

.title-band {
  background-color: #f5f6f7;
  padding-bottom: 16px;
}

.title-content h1 {
  margin-top: 12px;
  margin-bottom: 8px;
}

.title-content .intro-text {
  margin-bottom: 12px;
  max-width: 620px;
  line-height: 1.4;
}

/* ============================
   HERO (TITLE + INTRO)
   ============================ */

.hero {
  background: #f5f6f7;
  padding: 40px 0 32px;
}

.hero h1 {
  margin-bottom: 12px;
  font-size: 2rem;
  font-weight: 600;
}

.hero .intro-text {
  max-width: 720px;   /* visually matches form width */
  line-height: 1.5;
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 2.2rem;
  }
}

/* ============================
   TITLE TEXT GUTTER
   ============================ */

.container.title-content {
  padding-left: 24px;
  padding-right: 24px;
}

.container {
  max-width: var(--content-max-width);
  margin: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ============================
   SERVICE HEADER (DARK)
   ============================ */

.civic-header {
  background-color: #0c2d57;
  color: #ffffff;
  padding: 24px 0;
}

/* Header content container */
.civic-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.civic-header-left {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;           /* 👈 prevents collisions */
}

.civic-header-left strong {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.civic-subtitle {
  font-size: 13px;
  color: #e6edf7; /* clearer contrast */
  font-weight: 500;
}

.civic-header-right {
  font-size: 13px;
  color: #cfd9e6;
}