/* CSS Reset (modern minimal) */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color: #0E0E0E; background: var(--chalk-white); padding-top: var(--header-h, 0px); }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
html, body { overflow-x: hidden; }


/* Design tokens (tweak to match Figma) */
:root {
  --container-max: 1200px;
  --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px;

  /* Brand colors from user */
  --atlantic-blue: #03539D;
  --heather-purple: #C6069F;
  --gorse-yellow: #FCC600;
  --sea-mist: #F0F6FA;
  --chalk-white: #FAFAFA;
  --charcoal-grey: #3E3E3E;

  /* Defaults mapped for quick usage */
  --brand-900: var(--atlantic-blue);
  --brand-600: var(--heather-purple);
  --brand-100: var(--sea-mist);
  --text: var(--charcoal-grey);
  --muted: #60646C;
  --border: #E6E8EB;
}

:root {
  /* Hero visual spacing */
  --hero-gap: var(--space-6); /* 24px gap between content and visual */
}

h1, h2, h3 { font-family: 'Oxygen', system-ui, sans-serif; margin: 0 0 var(--space-4); line-height: 1.2; text-align: center; }
h1 { font-size: clamp(28px, 5.6vw, 40px); color: var(--charcoal-grey); }
/* h2 retained for any non-section headings */
h2 { font-size: clamp(22px, 4.6vw, 30px); color: var(--charcoal-grey); }
/* Color overrides for specific sections */
#mission h1 { color: var(--atlantic-blue); }
#mission-2 h1 { color: var(--heather-purple); }
#products h1 { color: var(--heather-purple); }
#who-we-are h1 { color: var(--heather-purple); }
#who-we-are .who-illustration { margin: 24px auto; max-width: 640px; }
#who-we-are .who-illustration img { display: block; width: clamp(320px, 45vw, 640px); height: auto; margin: 0 auto; }
#form h1 { color: var(--heather-purple); }
#form .form-illustration { margin: 24px auto; max-width: 320px; }
#form .form-illustration img { width: clamp(180px, 30vw, 320px); height: auto; margin: 0 auto; }
#form .form-mock { width: 240px; height: 240px; margin: 8px auto 0; display: grid; place-items: center; border-radius: 16px; border: 2px dashed var(--heather-purple); color: var(--muted); font-size: 12px; }



/* Extra space under testimonial in Mission 2 before CTA */
#mission-2 .testimonial { margin-bottom: 32px; }



p { margin: 0 0 var(--space-4); line-height: 1.2; color: var(--charcoal-grey); text-align: center; }
.modal .modal-section p { text-align: left; }

.container { width: min(100% - 40px, var(--container-max)); margin-inline: auto; }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #FFFFFF; border-bottom: 1px solid var(--border); }
/* Ensure Section 07 fits one viewport height on small screens */
@media (max-width: 420px) {
  #form.section { min-height: calc(100vh - var(--header-h, 0px)); display: flex; align-items: center; }
  #form .container { width: 100%; }
}

.header-inner { display: flex; align-items: center; justify-content: center; padding: var(--space-4) 0; }
.brand-link img.logo { height: 28px; width: auto; }

/* Sections */
.section { padding: 48px 0; background: var(--chalk-white); }
.section.alt { background: var(--sea-mist); }

/* Buttons and accents */
.btn.primary {
  display: inline-block;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--heather-purple), var(--heather-purple));
  color: var(--chalk-white);
  font-size: 16px;
  line-height: 1.2;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  border: 3px solid var(--gorse-yellow);
  position: relative;
  box-shadow: 0 4px 10px rgba(62,62,62,0.18);
  min-height: 44px;
  transform: translateZ(0);
}
.btn.primary::after {
  content: "";
  position: absolute;
/* Mission-2 inline illustration (not full-bleed) */
.section-illustration img { display:block; width: 100%; height:auto; margin: 16px auto; }

  inset: 0;
  border-radius: inherit;
  transform: translate(2px, 3px); /* subtle offset */
  background: rgba(62,62,62,0.18);
  filter: blur(4px);
  z-index: -1;
  pointer-events: none;
}

/* Mission-2 inline illustration (not full-bleed) */
.section-illustration { margin: 16px 0; }
.section-illustration img { display: block; width: 100%; height: auto; }

.btn.primary:hover { animation: cta-pulse 300ms ease-out 1; }
@keyframes cta-pulse {
  0% { transform: translateY(0) scale(1); box-shadow: 0 4px 10px rgba(62,62,62,0.18); }
  60% { transform: translateY(-0.5px) scale(1.015); box-shadow: 0 5px 12px rgba(62,62,62,0.2); }
  100% { transform: translateY(0) scale(1); box-shadow: 0 4px 10px rgba(62,62,62,0.18); }
}
@media (prefers-reduced-motion: reduce) {
  .btn.primary:hover { animation: none; }
}
.btn.primary:active { transform: translateY(1px); }
.btn.primary:active::after { transform: translate(2px, 2px); filter: blur(3px); }

/* Accessible focus styles for all site buttons */
.btn.primary:focus-visible,
.pfs-btn-next:focus-visible,
.pfs-btn-submit:focus-visible,
.pfs-btn-back:focus-visible,
#footer .btn-privacy:focus-visible {
  outline: 3px solid rgba(0,0,0,0.25);
  outline-offset: 2px;
}

.accent-purple { color: var(--heather-purple); }
.accent-blue { color: var(--atlantic-blue); }
.stars { text-align: center; color: var(--gorse-yellow); letter-spacing: 2px; margin-top: 8px; }

/* Hero visual spacing — Valley Rule: use variable for responsive, breakpoint-aware gap */
.hero-visual {
  margin: var(--hero-gap) 0 0;
  width: 100vw; max-width: 100vw;
  position: relative; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw; /* full-bleed out of container */
}

.hero-visual img { display: block; width: 100%; height: auto; }
/* Remove extra space below hero – image acts as divider */
#hero { padding-bottom: 0; }

/* Hero section responsive behavior - upward image shift from 720px+ */
@media (min-width: 720px) {
  /* Ensure copy stack has transparent backgrounds for layering */
  #hero h1, #hero p, #hero .testimonial {
    background: transparent;
    position: relative;
    z-index: 2;
  }

  /* Keep CTA button's original styling */
  #hero .btn.primary {
    position: relative;
    z-index: 2;
  }

  /* Progressive upward shift starts at 720px (baseline: 0px shift) */
  .hero-visual {
    transform: translateY(0px);
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* Ensure hero section maintains proper spacing */
  #hero {
    position: relative;
    overflow: visible;
  }

  /* Move Mission section up to follow the hero image */
  #mission {
    transform: translateY(0px);
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* Intermediate breakpoints for smoother progression */
@media (min-width: 800px) {
  /* 800px: ~28px upward shift (80px * 0.35 = 28px) */
  .hero-visual {
    transform: translateY(-28px);
  }

  /* Move Mission section up by same amount to follow hero image */
  #mission {
    transform: translateY(-28px);
  }

  /* Move all sections up by same amount to maintain consistent spacing */
  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-28px);
  }
}

@media (min-width: 900px) {
  /* 900px: ~63px upward shift (180px * 0.35 = 63px) */
  .hero-visual {
    transform: translateY(-63px);
  }

  #mission {
    transform: translateY(-63px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-63px);
  }
}

@media (min-width: 999px) {
  /* 999px: ~97px upward shift (279px * 0.35 = 97.65px) */
  .hero-visual {
    transform: translateY(-97px);
  }

  #mission {
    transform: translateY(-97px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-97px);
  }
}

@media (min-width: 1030px) {
  /* 1030px: ~108px upward shift (310px * 0.35 = 108.5px) */
  /* Transition to medium rate: 0.2px per 1px viewport growth */
  .hero-visual {
    transform: translateY(-108px);
  }

  #mission {
    transform: translateY(-108px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-108px);
  }
}

@media (min-width: 1120px) {
  /* 1120px: ~126px upward shift (108px + (90px * 0.2) = 126px) */
  .hero-visual {
    transform: translateY(-126px);
  }

  #mission {
    transform: translateY(-126px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-126px);
  }
}

@media (min-width: 1200px) {
  /* 1200px: ~142px upward shift (108px + (170px * 0.2) = 142px) */
  .hero-visual {
    transform: translateY(-142px);
  }

  #mission {
    transform: translateY(-142px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-142px);
  }
}

@media (min-width: 1440px) {
  /* 1440px: ~190px upward shift (108px + (410px * 0.2) = 190px) */
  .hero-visual {
    transform: translateY(-190px);
  }

  #mission {
    transform: translateY(-190px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-190px);
  }
}

@media (min-width: 1600px) {
  /* 1600px: ~222px upward shift (108px + (570px * 0.2) = 222px) */
  .hero-visual {
    transform: translateY(-222px);
  }

  #mission {
    transform: translateY(-222px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-222px);
  }
}

@media (min-width: 1920px) {
  /* 1920px: ~286px upward shift (108px + (890px * 0.2) = 286px) */
  .hero-visual {
    transform: translateY(-286px);
  }

  #mission {
    transform: translateY(-286px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-286px);
  }
}

@media (min-width: 2260px) {
  /* 2260px: ~354px upward shift (108px + (1230px * 0.2) = 354px) */
  .hero-visual {
    transform: translateY(-354px);
  }

  #mission {
    transform: translateY(-354px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-354px);
  }
}

@media (min-width: 2800px) {
  /* 2800px: ~462px upward shift (108px + (1770px * 0.2) = 462px) */
  .hero-visual {
    transform: translateY(-462px);
  }

  #mission {
    transform: translateY(-462px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-462px);
  }
}

/* Final cap at 3090px - maximum upward movement */
@media (min-width: 3090px) {
  /* 3090px: ~520px upward shift (108px + (2060px * 0.2) = 520px) - FINAL POSITION */
  .hero-visual {
    transform: translateY(-520px);
  }

  #mission {
    transform: translateY(-520px);
  }

  #mission-2, #products, #who-we-are, #form, #contact, #footer {
    transform: translateY(-520px);
  }
}

/* Smooth easing for all hero visual transforms */
@media (min-width: 720px) {
  .hero-visual {
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
  }
}

/* Collision guards - ensure minimum clearances are maintained */
@media (min-width: 720px) {
  /* Top guard: 28px minimum clearance from image to H1/body text */
  #hero h1 {
    margin-bottom: max(var(--space-4), 28px);
    position: relative;
    z-index: 3;
  }

  #hero p {
    position: relative;
    z-index: 3;
    margin-bottom: var(--space-4);
  }

  /* Bottom guard: 24px minimum clearance from testimonial to image */
  #hero .testimonial {
    margin-top: 32px; /* Fixed gap above testimonial */
    margin-bottom: 24px; /* Minimum clearance below testimonial */
    position: relative;
    z-index: 4;
  }

  /* Ensure CTA→testimonial gap remains fixed */
  #hero .btn.primary {
    margin-bottom: 0; /* Reset margin, let testimonial handle spacing */
    position: relative;
    z-index: 3;
  }

  /* Ensure proper stacking order */
  .hero-visual {
    position: relative;
    z-index: 1;
  }
}

/* Enhanced collision detection for larger screens */
@media (min-width: 1030px) {
  /* Slower approach rate to keep chimney clear of H1/body */
  #hero h1 {
    margin-bottom: max(var(--space-6), 32px); /* Increased clearance */
  }

  #hero p:first-of-type {
    margin-bottom: max(var(--space-6), 28px); /* Body text clearance */
  }
}


/* Full-bleed utility for section dividers */
.full-bleed { width: 100vw; max-width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }
.full-bleed img { display: block; width: 100%; height: auto; }
/* Mission section: attached to hero image above and section divider below */
#mission.section {
  padding: 48px 0 0 0 !important; /* Top padding for content, no bottom padding to stay attached to section divider */
}

/* Mission-2 section: adjusted padding to match visual spacing of other sections */
#mission-2.section {
  padding: 38px 0 48px 0 !important; /* Reduced top padding to compensate for extra visual space */
}


/* Products grid (mobile column) */
.products { list-style: none; padding: 0; margin: 16px auto 0; display: grid; gap: 8px; max-width: 700px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.products li { background: var(--chalk-white); border: 1px solid var(--heather-purple); border-radius: 12px; padding: 12px; text-align: center; box-shadow: 0 0 0 1px rgba(198,6,159,0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.products li:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 8px 18px rgba(62,62,62,0.16); border-color: var(--gorse-yellow); }
.products em { display: block; color: var(--heather-purple); margin-top: 0; font-style: normal; font-weight: 500; line-height: 1.2; }
.products li img { width: 50px; height: 50px; margin: 0 auto; }
.products .product-title { display: flex; height: 36px; justify-content: center; align-items: center; font-size: 16px; font-family: 'Oxygen', system-ui, sans-serif; font-weight: 700; color: var(--atlantic-blue); text-align: center; }


/* Testimonials */
.testimonial {
  margin: 32px auto 0; /* universal 32px gap above testimonials */
  padding: 0 20px; /* extra side padding for all testimonials */
  max-width: 560px;
  font-style: italic;
  color: var(--atlantic-blue);
  text-align: center;
  font-size: 12px; /* reduce testimonial text size */
  height: 120px; /* fixed height to prevent layout jump */
  overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
@media (min-width: 720px) {
  .testimonial { height: 140px; }
}
/* 32px gap above testimonials handled by base .testimonial rule */

.testimonial::before {
  content: '★★★★★';
  display: block;
  margin-bottom: 4px; /* 2px tighter between stars and quote */
  letter-spacing: 2px; /* more gap between stars */
  color: var(--gorse-yellow);
  -webkit-text-stroke: 0.5px var(--heather-purple); /* thinner purple stroke */
  text-shadow:
    0.5px 0 0 var(--heather-purple),
    -0.5px 0 0 var(--heather-purple),
    0 0.5px 0 var(--heather-purple),
    0 -0.5px 0 var(--heather-purple);
}
/* Testimonial name under quote */
.testimonial-name {
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--charcoal-grey);
}

/* Footer section styling per spec */
#footer.section { background: var(--charcoal-grey); }
#footer .disclaimers { color: var(--chalk-white); background: transparent; padding: 24px; border-radius: 0; }
#footer p { color: var(--chalk-white); text-align: left; }
#footer .disclaimers p:last-child { text-align: center; }
#footer strong { letter-spacing: 0.2px; }
#footer .btn-privacy {
  background: var(--heather-purple);
  color: var(--chalk-white);
  border: 2px solid var(--gorse-yellow);
  border-radius: 8px;
  padding: 12px 22px;
  font-weight: 600;
  min-height: 44px;
}
#footer .btn-privacy:hover { filter: brightness(1.05); }
#footer .btn-privacy:active { transform: translateY(1px); }

/* Footer action row (consistent spacing across 3-4 buttons) */
#footer .footer-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#footer .footer-actions .btn-privacy { margin: 0; }

/* Basic modal styles */

/* Modal chrome adjustments per PFS brief */
.modal-dialog { border: 2px solid var(--heather-purple); }
.modal-header { display: flex; align-items: center; justify-content: center; position: relative; }
.modal-header .modal-back { position: absolute; left: 8px; top: 8px; background: transparent; border: none; cursor: pointer; padding: 4px; }
.modal-header .modal-exit { position: absolute; right: 12px; top: 8px; background: transparent; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--heather-purple); }
.modal-header .modal-exit:hover { color: var(--atlantic-blue); }
.modal-header .modal-back img { display: block; width: 24px; height: 24px; }
.modal-header .modal-back:hover { opacity: 0.7; }
.modal-header .modal-title { color: var(--heather-purple); text-align: center; font-family: 'Oxygen', system-ui, sans-serif; font-weight: 700; }
/* Larger modal title (+20%) */
.modal-header .modal-title { font-size: clamp(22px, 6.2vw, 26px); }
/* Keep back button always visible above progress bar content */
#quote-modal .modal-header .modal-back { z-index: 1; }


.modal-footer { display: flex; justify-content: center; }
.modal-footer .btn.primary { font-weight: 400; }

.modal-footer .btn.primary { font-weight: 400; }

.modal[hidden] { display: none !important; }
.modal-header, .modal-footer { padding: 18px 20px; }
/* Ensure title is optically centered even with left back button */
.modal-header { min-height: 64px; }
.modal-header .modal-title { line-height: 1; margin: 0; }

.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-dialog { position: relative; margin: 0 auto; max-height: 92vh; width: min(92vw, 720px); background: var(--chalk-white); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); overflow: hidden; }
.modal-header, .modal-footer { padding: 18px 20px; background: var(--sea-mist); }

/* Product modal-specific tweaks using PFS brand */
.modal .modal-header { background: var(--sea-mist); justify-content: center; position: relative; }
.modal .modal-footer { background: var(--sea-mist); }
/* Ensure product modal has the back button pinned top-left like the quote modal */
#product-modal .modal-header .modal-back { position: absolute; left: 8px; top: 8px; background: transparent; border: none; padding: 4px; cursor: pointer; }
#product-modal .modal-header .modal-back img { width: 24px; height: 24px; display: block; }
#product-modal .modal-header .modal-title { text-align: center; margin: 0; }
/* Modal body typography and spacing */
/* Product modal should not preserve whitespace like Privacy modal */
#product-modal .privacy-content { white-space: normal; line-height: 1.2; }

.modal .modal-body { line-height: 1.2; }
.modal .modal-section { padding: 10px 12px 14px; }
.modal .modal-section:first-child { padding-top: 10px; }
/* Product icon in modal first section */
.modal .modal-section .product-icon {
  float: right;
  width: 72px;
  height: 72px;
  margin: 0 0 6px 10px;
}
@media (min-width: 480px) {
  .modal .modal-section .product-icon { width: 88px; height: 88px; }
}

.modal .modal-section h4 { color: var(--atlantic-blue); margin: 8px 0 10px; font-weight: 700; font-size: 18px; text-align: left; }
.modal .modal-checklist { line-height: 1.2; }

.modal .modal-header h3 { color: var(--heather-purple); font-family: 'Oxygen', system-ui, sans-serif; }
.modal .modal-body .hook { color: var(--atlantic-blue); margin-top: 10px; text-align: left; }
.modal .modal-checklist { list-style: none; padding-left: 0; margin: 8px 0; }
.modal .modal-checklist li { position: relative; padding-left: 36px; margin: 8px 0; }
.modal .modal-checklist li::before { content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; background: url('../Assets/heather_purple_tick.svg') no-repeat center/contain; }
@media (min-width: 480px) {
  .modal .modal-checklist li { padding-left: 40px; }
  .modal .modal-checklist li::before { width: 24px; height: 24px; top: 0; }
}
.modal .disclaimer { color: var(--atlantic-blue); background: #f7fbff; border-left: 4px solid var(--heather-purple); padding: 8px 12px; border-radius: 8px; text-align: center; }
.modal .two-col { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .modal .two-col { grid-template-columns: 1fr 1fr; } }

/* Make product cards act like buttons */
.product-card { all: unset; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.product-card:focus-visible { outline: 3px solid var(--gorse-yellow); outline-offset: 3px; border-radius: 12px; }

.modal-body { padding: 16px; max-height: 60vh; overflow: auto; }
.modal-close { background: transparent; border: 0; font-size: 24px; line-height: 1; cursor: pointer; }
.privacy-content { white-space: normal; line-height: 1.35; color: var(--charcoal-grey); }
.privacy-content a { color: var(--atlantic-blue); text-decoration: underline; }
@media (prefers-color-scheme: dark) { .privacy-content { color: var(--chalk-white); } }

/* Improved markdown styling for privacy/complaints content */
.privacy-content { font-family: inherit; text-align: left; font-weight: 400; }
.privacy-content h2, .privacy-content h3 { color: var(--atlantic-blue); font-weight: 700; text-align: left; margin: 0.6rem 0 0.35rem; font-size: 1.1rem; }
.privacy-content p { margin: 0.35rem 0; text-align: left; }
.privacy-content ul { list-style: none; padding-left: 0; margin: 0.35rem 0; }
.privacy-content ul li { position: relative; padding-left: 20px; margin: 0.2rem 0; }
.privacy-content ul li::before { content: '\2192'; /* right arrow */ color: var(--atlantic-blue); position: absolute; left: 0; top: 0; }
.privacy-content hr { border: 0; border-top: 1px solid rgba(0,0,0,0.12); margin: 0.75rem 0; }
.privacy-content strong { font-weight: 700; }


@media (prefers-color-scheme: dark) {
  .modal-dialog { background: #111; color: var(--chalk-white); }
}

/* Footer */
.disclaimers { color: var(--chalk-white); background: var(--charcoal-grey); padding: 24px; border-radius: 16px; }
.disclaimers a, .footer-link { color: var(--chalk-white); text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* Account for fixed header when using in-page anchors */
:target { scroll-margin-top: var(--header-h, 80px); }

/* ===== PFS FORM STYLES ===== */
.pfs-form-wrapper {
  max-width: 600px;
  margin: 3.25rem auto; /* extra headroom so title doesn't clash with content above */
  background: #FAFAFA;
  border-radius: 20px;
  padding: 3.25rem 2rem 2rem; /* more top padding so progress bar breathes */
  box-shadow: 0 8px 24px rgba(3, 83, 157, 0.1);
  border: 4px solid var(--heather-purple);
  position: relative;
  box-sizing: border-box; /* ensure internal padding is symmetrical inside purple border */
  overflow: visible; /* ensure the title badge can overlap the border */
}

.pfs-form-title {
  position: absolute;
  top: -20px; /* move up slightly so text sits centered across the thicker 4px border */
  left: 50%;
  transform: translateX(-50%);
  background: #FAFAFA;
  color: var(--atlantic-blue); /* badge title should be Atlantic Blue */
  font-family: 'Oxygen', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: none;
  box-shadow: 0 4px 10px rgba(3,83,157,0.06);
  white-space: nowrap;
  z-index: 6;
}

.pfs-form-title-label { position: relative; z-index: 7; }

/* Remove any masking pseudo-element so nothing draws inside the card */
.pfs-form-title::after { display: none; content: none; }

/* Mobile adjustments for proportions */
@media (max-width: 480px) {
  .pfs-form-wrapper { margin: 3.75rem 1rem 2rem; padding-top: 3.75rem; }
  .pfs-form-title { top: -14px; font-size: 1.2rem; }
  .pfs-form-progress { margin-top: 1rem; }
}


.pfs-form-progress {
  margin-top: 0.75rem; /* add clear space under the badge */
  margin-bottom: 2rem;
}

.progress-bar {
  background: var(--sea-mist);
  border-radius: 10px;
  height: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--atlantic-blue), var(--heather-purple));
  height: 100%;

/* Compact layout for short mobile viewports: tighten spacing so form fits on screen */
@media (max-height: 740px) and (max-width: 420px) {
  .pfs-form-wrapper { padding-top: 2.6rem; padding-bottom: 1.2rem; }
  .pfs-form-title { top: -18px; font-size: 1.1rem; }
  .pfs-form-progress { margin-top: 0.5rem; margin-bottom: 1rem; }
  .progress-bar { height: 6px; margin-bottom: 0.5rem; }
  .step-indicator { font-size: 1rem; }
  .step-content h2 { font-size: 1.25rem; margin-bottom: 0.45rem; line-height: 1.25; }
  .slider-container { margin: 0.75rem 0 0.5rem; }
  .pfs-slider { height: 6px; margin: 0.5rem 0; }
  .pfs-slider::-webkit-slider-thumb { width: 20px; height: 20px; }
  .pfs-slider::-moz-range-thumb { width: 20px; height: 20px; }
  .slider-value { font-size: 1.35rem; margin: 0.5rem 0 0.25rem; }
  .slider-labels { font-size: 0.85rem; margin-top: 0.25rem; }
  .helper-text { font-size: 0.85rem; margin: 0.75rem 0; }
  .pfs-btn-next, .pfs-btn-submit { padding: 0.9rem 1.25rem; margin-top: 1rem; }
}

  width: 25%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.step-indicator {
  text-align: center;
  font-weight: 600;
  color: var(--atlantic-blue);
  font-size: 1.1rem;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-content h2 {
  color: var(--atlantic-blue);
  font-family: 'Oxygen', system-ui, sans-serif;
  font-size: 1.3rem; /* slightly smaller to save space */
  text-align: center;
  margin-bottom: 0.5rem; /* tighter spacing */
  line-height: 1.2;
}

/* Slider Styles */
.slider-container {
  margin: 0.6rem 0; /* tighter around the slider */
  display: grid;
  grid-template-columns: 1fr; /* single column layout */
  grid-template-rows: auto auto auto; /* value, slider, labels */
  align-items: center;
  row-gap: 12px;
  justify-items: center;
}
/* When a heading label is present above the slider, use 3 rows */
.slider-container.with-label { grid-template-rows: auto auto auto; }

/* Place internal heading label full width in row 1 when present */
.slider-container.with-label > label { grid-column: 1 / -1; grid-row: 1; justify-self: center; margin-bottom: 0.25rem; }
/* Slider track always spans the row below the heading */
.slider-container.with-label .pfs-slider { grid-row: 2; grid-column: 1 / -1; }
/* Labels + value occupy the third row */
.slider-container.with-label > .slider-value { grid-row: 3; grid-column: 2; justify-self: center; margin: 0; }
.slider-container.with-label > .slider-labels { grid-row: 3; grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }


/* Value at top (row 1) */
.slider-container .slider-value {
  grid-row: 1;
  justify-self: center;
  align-self: center;
  margin: 0;
}

/* Slider in middle (row 2) */
.slider-container .pfs-slider {
  grid-row: 2;
  width: 100%;
}

/* Labels at bottom (row 3) */
.slider-container .slider-labels {
  grid-row: 3;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-container .slider-labels span:first-child { text-align: left; }
.slider-container .slider-labels span:last-child { text-align: right; }

/* Ensure optional <label> inside slider-container spans full width */
.slider-container > label { grid-column: 1 / -1; justify-self: center; margin-bottom: 0.25rem; }



.slider-container label {
  display: block;
  color: var(--atlantic-blue);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.pfs-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: var(--sea-mist);
  outline: none;
  margin: 1rem 0;
  cursor: pointer;
}

.pfs-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--heather-purple);
  cursor: pointer;
  border: 3px solid var(--chalk-white);
  box-shadow: 0 2px 8px rgba(198, 6, 159, 0.3);
  transition: all 0.2s ease;
}

.pfs-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(198, 6, 159, 0.4);
}

.pfs-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--heather-purple);
  cursor: pointer;

/* Align slider end labels inline with the numeric counter */

/* Robust inline centering: labels at edges, value absolutely centered */
.slider-inline{ position: relative; display: flex !important; align-items: center; justify-content: space-between; width: 100%; }
.slider-inline .slider-ends{ flex: 1; }
.slider-inline .slider-value{ position: absolute; left: 50%; transform: translateX(-50%); margin: 0; text-align: center; }

/* grid fallback for older browsers; flex/absolute rule above takes precedence */
.slider-inline { grid-column: 1 / -1; display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; column-gap:8px; }
.slider-inline .slider-ends { color: var(--muted); font-size: 0.85rem; }
.slider-inline .slider-ends:first-child { justify-self: start; text-align: left; }
.slider-inline .slider-ends:last-child { justify-self: end; text-align: right; }

  border: 3px solid var(--chalk-white);
  box-shadow: 0 2px 8px rgba(198, 6, 159, 0.3);
  transition: all 0.2s ease;
}

.slider-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--atlantic-blue);
  margin: 0.5rem 0 0.25rem; /* reduce vertical whitespace */
  font-family: 'Oxygen', system-ui, sans-serif;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 700;
}

/* Option Cards */
.option-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .option-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Denser grid for Purpose cards (Step 2) */
.purpose-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  /* Center the grid block within the purple frame with equal left/right gutter */
  margin: 1rem auto;
  padding-inline: 8px;
  max-width: 520px; /* ensure optical centering on narrow viewports */
}
@media (min-width: 600px) { .purpose-grid { grid-template-columns: repeat(3, 1fr); max-width: 560px; } }
@media (min-width: 900px) { .purpose-grid { grid-template-columns: repeat(3, 1fr); max-width: 600px; } }

/* Make each card compact, like product tiles */
.purpose-grid .card-content {
  padding: 0.9rem 0.8rem;
  border-radius: 14px;
  font-weight: 700;
}

/* Equal height tiles */
.purpose-grid .option-card { display: flex; }
.purpose-grid .card-content {
  flex: 1; display: grid; place-items: center; min-height: 64px;
  /* Ensure equal internal horizontal padding so text doesn't look offset */
  padding-inline: 0.85rem;
}

/* Reduce hover lift for compact grid */
.purpose-grid .option-card:hover .card-content { transform: translateY(-1px); }

/* When selected, keep strong contrast and compact look */
.purpose-grid .option-card input[type="radio"]:checked + .card-content,
.purpose-grid .option-card input[type="checkbox"]:checked + .card-content { box-shadow: 0 3px 12px rgba(198, 6, 159, 0.25); }


.option-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.card-content {
  display: block;
  padding: 1.2rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--atlantic-blue), #025ba3);
  border: 3px solid var(--heather-purple);
  border-radius: 12px;
  text-align: center;
  font-weight: 500;
  color: var(--chalk-white);
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 10px rgba(3, 83, 157, 0.18);
}

.option-card:hover .card-content {
  border-color: var(--atlantic-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 92, 255, 0.15);
}


/* Yes/No cards (P3 & P5): match Next button hover with gorse yellow glow */
#step3 .option-card:hover .card-content,
#step5 .option-card:hover .card-content {
  /* Keep blue base, but use the same yellow emphasis as .pfs-btn-next:hover */
  border-color: var(--gorse-yellow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 208, 0, 0.3);
}

/* When selected and hovered, slightly stronger yellow glow */
#step3 .option-card:hover input[type="radio"]:checked + .card-content,
#step5 .option-card:hover input[type="radio"]:checked + .card-content {
  box-shadow: 0 8px 24px rgba(255, 208, 0, 0.35);
}

/* Selected state: gorse yellow */
.option-card input[type="radio"]:checked + .card-content {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--gorse-yellow), #e6c200);
  color: var(--atlantic-blue);
  border-color: var(--gorse-yellow);
  box-shadow: 0 4px 16px rgba(255, 208, 0, 0.25);
}

.option-card input[type="radio"]:focus + .card-content {
  outline: 3px solid var(--gorse-yellow);
  outline-offset: 2px;
}

/* Other Input Container */
.other-input-container {
  margin-top: 1rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 100px; }
}

/* Property Details */
.property-details {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--sea-mist);
  animation: slideDown 0.3s ease;
}

/* Form Fields */
.form-fields {
  margin: 2rem 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field-group {
  margin-bottom: 1.5rem;
}

.pfs-input {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 2px solid var(--sea-mist);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--chalk-white);
  color: var(--atlantic-blue);
  transition: all 0.2s ease;
}

.pfs-input:focus {
  outline: none;
  border-color: var(--heather-purple);
  box-shadow: 0 0 0 3px rgba(198, 6, 159, 0.1);
}

.pfs-input::placeholder {
  color: var(--muted);
}

.pfs-input.error {
  border-color: #e74c3c;
  background-color: #fdf2f2;
}

/* Validation Messages */
.validation-message {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
  font-weight: 500;
}

.validation-message.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Consent Container */
.consent-container {
  margin: 2rem 0;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  gap: 0.75rem;
}

.consent-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--sea-mist);
  border-radius: 4px;
  background: var(--chalk-white);
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.consent-label:hover .checkmark {
  border-color: var(--heather-purple);
}

.consent-label input[type="checkbox"]:checked + .checkmark {
  background: var(--heather-purple);
  border-color: var(--heather-purple);
}

.consent-label input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid var(--chalk-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-label input[type="checkbox"]:focus + .checkmark {
  outline: 3px solid var(--gorse-yellow);
  outline-offset: 2px;
}

.consent-text {
  color: var(--atlantic-blue);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Buttons */
.pfs-nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
}

.pfs-nav-row.pfs-nav-single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.pfs-btn-back,
.pfs-btn-next,
.pfs-btn-submit {
  width: 100%;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.pfs-btn-back {
  background: #e9eef5;
  color: var(--atlantic-blue);
  border: none;
}

.pfs-btn-next,
.pfs-btn-submit {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--heather-purple), var(--heather-purple));
  color: var(--chalk-white);
  border: 3px solid var(--gorse-yellow);
  box-shadow: 0 4px 10px rgba(198, 6, 159, 0.18);
}

/* Match CTA hover/active behavior */
.pfs-btn-next:hover, .pfs-btn-submit:hover { animation: cta-pulse 300ms ease-out 1; }
.pfs-btn-next:active, .pfs-btn-submit:active { transform: translateY(1px); }


/* Review list styling */
.review-list { list-style: none; padding: 0; margin: 1rem 0 0; }
/* Two-column grid: fixed label column, flexible value column that wraps */
.review-list li {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
  padding: 10px 14px;
  background: var(--sea-mist);
  border-radius: 10px;
  margin-bottom: 10px;
  color: var(--atlantic-blue);
}
.review-list li strong { color: var(--atlantic-blue); white-space: nowrap; }
.review-list li span { font-weight: 700; word-break: break-word; }
@media (max-width: 480px) {
  .review-list li { grid-template-columns: 1fr; }
  .review-list li strong { margin-bottom: 2px; }
}

/* Review subheading styling */
.review-subheading { text-align: center; color: var(--atlantic-blue); margin: 0.25rem 0 0.75rem; font-weight: 600; }
.review-subheading span { font-weight: 800; }


/* Review page inline helper text spacing */
.review-instructions { margin-top: 0.75rem; margin-bottom: 0.5rem; text-align: center; }


.pfs-btn-next:hover,
.pfs-btn-submit:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, var(--heather-purple), var(--heather-purple));
  color: var(--chalk-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 208, 0, 0.3);
}
.pfs-btn-back:hover { filter: brightness(0.98); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(3,83,157,0.12); }

.pfs-btn-next:active, .pfs-btn-submit:active, .pfs-btn-back:active { transform: translateY(0); }
.pfs-btn-next:focus, .pfs-btn-submit:focus, .pfs-btn-back:focus { outline: 3px solid var(--gorse-yellow); outline-offset: 2px; }

.pfs-btn-submit:disabled { background: var(--muted); cursor: not-allowed; transform: none; box-shadow: none; }

/* Helper Text */
.helper-text {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.4rem 0; /* reduce vertical whitespace between headline and helper texts */
  font-style: italic;
  line-height: 1.25;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  .pfs-form-wrapper {
    margin: 1rem;
    padding: 1.5rem;
    border-radius: 16px;
  }
  /* 375px target: tighten chrome and give content full width */
  .modal { padding: 12px; }
  .modal-dialog { width: 100%; max-width: 368px; margin-bottom: max(8px, env(safe-area-inset-bottom)); }
  .pfs-form-wrapper { margin: 0; padding: 1rem; }
  .purpose-grid { width: 100%; max-width: none; padding-inline: 6px; margin: 0.5rem 0; }
  .purpose-grid .card-content { padding: 0.85rem 0.8rem; }


  .step-content h2 { font-size: 1.25rem; }
  .option-cards.purpose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .option-cards.purpose-grid .card-content { min-height: 60px; font-size: 1rem; }
  .pfs-nav-row.pfs-nav-single { margin-top: 0.5rem; }

  .slider-value {
    font-size: 1.5rem;
  }

  .option-cards {
    gap: 0.75rem;
  }

  .card-content {
    padding: 1rem;
    font-size: 0.95rem;
  }
}

/* 390px base tweaks */
@media (max-width: 420px) {
  :root { --container-max: 100%; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
}


/* When any modal is open, neutralize transforms on sections so fixed overlays use the viewport */
html.modal-open #hero,
html.modal-open #mission,
html.modal-open #mission-2,
html.modal-open #products,
html.modal-open #who-we-are,
html.modal-open #form,
html.modal-open .hero-visual {
  transform: none !important;
}

/* === PFS Quote Modal: Adopt fullscreen overlay structure (structure only; keep PFS brand) === */
/* Ensure modal overlay covers full viewport on all devices */
#quote-modal.modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh; /* visual viewport height to account for browser UI */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Ensure modal is always on top and centered regardless of body positioning */
  z-index: 2000;
  /* Use viewport units to ensure proper centering */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
#quote-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
}

/* Fixed-size outer container that does not change height as pages paginate */
#quote-modal .modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 372px; /* 375 mobile baseline minus safe padding */
  /* Use visual viewport height and reserve room for bottom browser UI */
  height: calc(100svh - 48px - env(safe-area-inset-bottom));
  max-height: calc(100svh - 48px - env(safe-area-inset-bottom));
  border: 2px solid var(--heather-purple); /* keep PFS colour */
  background: var(--chalk-white);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  overflow: hidden;
  /* Keep clear of bottom browser chrome */
  margin: 0 0 max(12px, env(safe-area-inset-bottom)) 0;
}

/* Make body fill the dialog and prevent height changes */
#quote-modal .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: hidden; /* no outer scroll; inner container manages overflow */
  max-height: none; /* override generic 60vh limit so inner frame can fill dialog */
  height: auto;
}

/* Inner fixed content container sized to the tallest step */
#quote-modal .pfs-form-wrapper {
  margin: 0;
  padding: 16px;
  border: 4px solid var(--heather-purple);
  border-radius: 16px;
  background: #FAFAFA;
  flex: 1;                /* fill modal-body */
  display: flex;
  flex-direction: column; /* allow progress + steps to stack */
  min-height: 0;          /* enable flex children to size */
}

#quote-modal .pfs-form { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* Keep one active step visible, but make it fill the fixed container so height is stable */
#quote-modal .form-step { display: none; min-height: 0; }
#quote-modal .form-step.active {
  display: flex;
  flex-direction: column;
  flex: 1;       /* take available height so container stays constant */
  min-height: 0; /* allow internal content to flex */
}

/* Ensure P4/P6 counters appear centered above slider like P1 */
#quote-modal .slider-container.with-label { grid-template-rows: auto auto auto auto; }
#quote-modal .slider-container.with-label > .slider-value { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin: 0.25rem 0; }
#quote-modal .slider-container.with-label .pfs-slider { grid-row: 3; grid-column: 1 / -1; }
#quote-modal .slider-container.with-label > .slider-labels { grid-row: 4; grid-column: 1 / -1; }

#quote-modal .step-content { flex: 1; display: flex; flex-direction: column; }
#quote-modal .pfs-nav-row { margin-top: auto; padding-top: 8px; }

/* Let internal content scroll only if absolutely needed on very short screens */
@media (max-height: 640px) {
  #quote-modal .form-step.active { overflow-y: auto; }
}

/* Scale up container on wider screens while keeping fixed container behaviour */
/* Mobile fine-tuning for iPhones up to 480px wide (includes 430px Pro/Max) */
@media (max-width: 480px) {
  /* Slim header to move content up */
  #quote-modal .modal-header, #quote-modal .modal-footer { padding: 10px 12px; }
  #quote-modal .modal-header { min-height: 48px; }
  #quote-modal .modal-title { font-size: clamp(20px, 5.2vw, 23px); }

  /* Reduce spacing under progress; keep badge breathing room */
  #quote-modal .pfs-form-progress { margin-bottom: 0.3rem; }
  /* Pull the step label closer to the heading by tightening the bar's bottom margin */
  #quote-modal .progress-bar { margin-bottom: 0.45rem; }
  /* Ensure inner frame comfortably contains the Next/Submit button */
  #quote-modal .pfs-form-wrapper { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
  /* Tighten vertical rhythm on headings and helper text */
  #quote-modal .step-content h2 { margin-top: 0; margin-bottom: 0.4rem; font-size: 1.1rem; }
  .helper-text { margin: 0.3rem 0; }
  /* Contact details: tighten vertical spacing so Submit is visible */
  #quote-modal .form-fields { margin: 0.2rem 0; }
  #quote-modal .field-row { gap: 0.3rem; }
  #quote-modal .field-group { margin-bottom: 0.3rem; }
  #quote-modal .consent-container { margin: 0.5rem 0 0.35rem; }
  #quote-modal .pfs-input { padding: 0.48rem 0.75rem; font-size: 0.95rem; }
  /* Compact the purpose grid so no scroll is needed */
  .option-cards.purpose-grid { gap: 0.6rem; }
  .option-cards.purpose-grid .card-content { min-height: 56px; font-size: 0.95rem; }
}

/* Ultra-compact tuning specifically for ~844px tall iPhones (12/13/14/15/16 variants) */
@media (max-width: 480px) and (max-height: 844px) {
  #quote-modal .pfs-form-wrapper { padding: 10px 12px calc(20px + env(safe-area-inset-bottom)); }
  #quote-modal .pfs-form-progress { margin-bottom: 0.25rem; }
  #quote-modal .progress-bar { margin-bottom: 0.4rem; }
  #quote-modal .step-content h2 { font-size: 1.05rem; margin-bottom: 0.35rem; }
  #quote-modal .field-group { margin-bottom: 0.28rem; }
  #quote-modal .pfs-input { padding: 0.46rem 0.72rem; }
  #quote-modal .pfs-nav-row { padding-top: 6px; }
}


/* Extra-tight layout for very small widths */
@media (max-width: 360px) {
  #quote-modal .pfs-form-progress { margin-bottom: 0.9rem; }
  .option-cards.purpose-grid { gap: 0.5rem; }
  .option-cards.purpose-grid .card-content { min-height: 54px; font-size: 0.93rem; }
}

@media (min-width: 420px) {
  #quote-modal .modal-dialog { max-width: 420px; max-height: calc(100svh - 64px - env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) {
  #quote-modal .modal-dialog { max-width: 520px; max-height: min(880px, calc(100svh - 64px)); }
  #quote-modal .pfs-form-wrapper { padding: 20px; border-radius: 18px; }
}
@media (min-width: 1024px) {
  #quote-modal .modal-dialog { max-width: 620px; max-height: min(920px, calc(100svh - 72px)); }
}

/* Ensure modal is always centered and visible on all screen sizes */
@media (max-height: 600px) {
  #quote-modal .modal-dialog {
    max-height: calc(100svh - 32px - env(safe-area-inset-bottom));
    margin-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Additional centering insurance for very small screens */
@media (max-width: 375px) {
  #quote-modal.modal { padding: 8px; }
  #quote-modal .modal-dialog { max-width: calc(100vw - 16px); }
}


/* Subtle scale-ups starting from 720px */
@media (min-width: 720px) {
  /* Header PFS logo: ~+10% */
  .brand-link img.logo { height: 31px; }

  /* Body copy in main sections (avoid modal content) — add ~2px */
  .section p { font-size: 18px; }

  /* Testimonials: nudge text up by ~2px */
  .testimonial { font-size: 14px; }
  .testimonial-name { font-size: 14px; }
}
/* Progressive logo bumps on wider viewports */
@media (min-width: 1100px) { .brand-link img.logo { height: 34px; } }
@media (min-width: 2000px) { .brand-link img.logo { height: 37px; } }
@media (min-width: 3000px) { .brand-link img.logo { height: 40px; } }


/* Contact section styling */
#contact.section.contact { background: var(--heather-purple); color: var(--gorse-yellow); }
#contact .container a { color: var(--chalk-white); text-decoration: underline; }
#contact h1 { color: var(--chalk-white); }

#contact p { color: var(--gorse-yellow); }


/* Progressive testimonial text bumps on wider viewports */
@media (min-width: 1100px) { .testimonial, .testimonial-name { font-size: 15px; } }
@media (min-width: 2000px) { .testimonial, .testimonial-name { font-size: 16px; } }
@media (min-width: 3000px) { .testimonial, .testimonial-name { font-size: 17px; } }


/* Adjust star row spacing as testimonial text scales */
@media (min-width: 720px)  { .testimonial::before { margin-bottom: 6px; } }
@media (min-width: 1100px) { .testimonial::before { margin-bottom: 8px; } }
@media (min-width: 2000px) { .testimonial::before { margin-bottom: 10px; } }
@media (min-width: 3000px) { .testimonial::before { margin-bottom: 12px; } }


/* Scale testimonial stars as viewport widens */
@media (min-width: 720px)  { .testimonial::before { font-size: 16px; } }
@media (min-width: 1100px) { .testimonial::before { font-size: 18px; } }
@media (min-width: 2000px) { .testimonial::before { font-size: 20px; } }
@media (min-width: 3000px) { .testimonial::before { font-size: 22px; } }
