/* Standalone pages (the legal pages, free estimate) and the Logika forms: the multi-step estimate form and
   the homepage's single-step contact and callback cards share the .est styles. Loaded after styles.css,
   which holds the tokens, buttons and the shared chrome. */
.legal, .est-page { padding: calc(112px + env(safe-area-inset-top)) 0 var(--sec); }

/* ---------- Legal pages ---------- */
.legal-wrap { width: min(760px, 100% - 2 * var(--pad)); }
.legal h1 { font-size: clamp(34px, 4.4vw, 52px); font-weight: 800; color: var(--purple-ink); }
.legal-updated { margin-top: 14px; font-size: 14px; color: var(--slate); }
.legal-copy { margin-top: 36px; font-size: 16.5px; line-height: 1.7; }
.legal-copy h2 { margin: 44px 0 14px; font-size: clamp(21px, 2.2vw, 26px); font-weight: 700; line-height: 1.25; color: var(--purple-ink); }
.legal-copy p, .legal-copy ul { margin: 0 0 16px; }
.legal-copy ul { padding-left: 1.3em; }
.legal-copy li { margin: 6px 0; }
.legal-copy li::marker { color: var(--purple); }
.legal-copy strong { font-weight: 700; }

/* ---------- Free estimate page and the Logika forms ---------- */
.est-wrap { width: min(720px, 100% - 2 * var(--pad)); }
.est-page h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; line-height: 1.08; color: var(--purple-ink); }
.est-lead { margin-top: 14px; max-width: 56ch; font-size: 17px; color: var(--slate); }
.est-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding: 0; list-style: none; }
.est-trust li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--tint); color: var(--purple-ink); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.est-trust li::before { content: "\2713"; color: var(--purple); font-weight: 800; }
.est-panel { margin-top: 28px; padding: clamp(20px, 4vw, 36px); border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: 0 24px 60px rgba(42, 15, 69, 0.08); }

.est [hidden] { display: none !important; }
/* Focus moves (step title, first invalid field, the thank-you) scroll clear of the fixed header */
.est-step-title, .est input, .est textarea, .est-status { scroll-margin-top: calc(120px + env(safe-area-inset-top)); }
.est-progress { margin-bottom: 22px; }
.est-progress-label { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--purple); }
.est-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 10px; padding: 0; list-style: none; }
.est-bar li { height: 5px; border-radius: 999px; background: var(--line); transition: background 0.3s var(--ease); }
.est-bar li.is-done, .est-bar li.is-current { background: var(--purple); }
.est-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.est-step { display: grid; gap: 20px; }
.est-step-title { font-size: clamp(21px, 2.4vw, 26px); font-weight: 700; line-height: 1.2; }
.est-step-title:focus { outline: none; }

.est-field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.est-field > label, .est-field > legend { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.est-field > legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; }
.est-field > legend + * { clear: both; }
.est-req { color: var(--purple); }
.est-opt { font-size: 13px; font-weight: 500; color: var(--slate); }
.est input[type="text"], .est input[type="email"], .est input[type="tel"], .est input[type="date"], .est input[type="time"], .est textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 1.5px solid #d8d3e3; border-radius: 12px; background: var(--white);
  color: var(--ink); font: 500 16px/1.4 "Montserrat", system-ui, sans-serif; transition: border-color 0.2s, box-shadow 0.2s;
}
.est textarea { min-height: 104px; resize: vertical; }
.est input::placeholder, .est textarea::placeholder { color: #8f8a9c; opacity: 1; }
.est input:focus, .est textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(107, 47, 163, 0.16); }
.est input[aria-invalid="true"], .est textarea[aria-invalid="true"] { border-color: #b3261e; }
.est-hint { font-size: 13px; color: var(--slate); }
.est-error { font-size: 13.5px; font-weight: 600; color: #b3261e; }

/* Radio cards and multiselect chips: the native input stays in place (focusable, clickable) under the card face */
.est-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.est-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.est-card, .est-chip { position: relative; display: block; cursor: pointer; }
.est-card input, .est-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.est-card span { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 56px; padding: 12px 16px; border: 1.5px solid #d8d3e3; border-radius: 14px; background: var(--white); font-size: 15px; font-weight: 600; line-height: 1.3; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.est-card span::before { content: ""; flex: none; width: 20px; height: 20px; border: 2px solid #b9b3c7; border-radius: 50%; background: var(--white); transition: border-color 0.2s, background 0.2s; }
.est-card input:checked + span { border-color: var(--purple); background: var(--tint); }
.est-card input:checked + span::before { border-color: var(--purple); background: radial-gradient(circle, var(--purple) 0 5px, var(--white) 5.5px); }
.est-chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1.5px solid #d8d3e3; border-radius: 999px; background: var(--white); font-size: 14px; font-weight: 600; line-height: 1.2; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.est-chip input:checked + span { border-color: var(--purple); background: var(--purple); color: var(--white); }
.est-chip input:checked + span::before { content: "\2713"; font-weight: 800; }
.est-card:hover span, .est-chip:hover span { border-color: var(--purple); }
.est-card input:focus-visible + span, .est-chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(107, 47, 163, 0.28); }
.est-card input[aria-invalid="true"] + span { border-color: #b3261e; }
.est-fields:disabled .est-card, .est-fields:disabled .est-chip, .est-fields:disabled input { cursor: not-allowed; }
.est-closed .est-fields { opacity: 0.55; }

.est-consent { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.55; color: var(--slate); cursor: pointer; }
.est-consent input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--purple); }
/* The optional SMS checkbox: its own title, its exact text, its terms right under it */
.est-sms-field { gap: 6px; }
.est-consent-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.est-sms-links { padding-left: 34px; font-size: 13.5px; color: var(--slate); }
.est-sms-links a { display: inline-block; padding: 6px 0; color: var(--purple); font-weight: 700; }
.est-privacy, .est-contact, .est-noscript { font-size: 14px; color: var(--slate); }
.est-privacy a, .est-contact a, .est-noscript a { color: var(--purple); font-weight: 700; }

.est-summary { margin: 0; border-top: 1px solid var(--line); }
.est-summary div { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.est-summary dt { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.est-summary dd { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }

.est-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.est-actions [data-est-next], .est-actions [data-est-submit] { margin-left: auto; }
.est-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.est-status { margin-top: 16px; font-size: 14.5px; font-weight: 600; color: var(--purple-ink); }
.est-status:empty { display: none; }
.est-status:focus { outline: none; }
.est-contact, .est-noscript { margin-top: 12px; }

/* Single-step forms (the homepage contact and callback cards): the fields in two columns, long ones across */
.est-simple .est-step { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.est-simple .est-step > .est-consent-field, .est-simple .est-step > .est-field:has(textarea) { grid-column: 1 / -1; }
.est-simple .est-privacy { margin-top: 18px; }
.est-simple .est-actions { margin-top: 20px; }
.est-simple .est-actions [data-est-submit] { margin-left: 0; }

/* Accepted: the steps give way to the thank-you message */
.est.is-done .est-progress, .est.is-done .est-fields, .est.is-done .est-actions { display: none; }
.est.is-done .est-status { margin: 0; padding: 22px 24px; border-radius: 16px; background: var(--tint); font-size: 17px; line-height: 1.5; }

@media (max-width: 899px) {
  .legal, .est-page { padding-top: calc(100px + env(safe-area-inset-top)); }
}
@media (max-width: 560px) {
  .est-simple .est-step { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .est-actions .btn { flex: 1 1 auto; }
}

/* ---------- Service, borough and contact pages (src/service-pages.mjs) ---------- */
/* The homepage's own components carry these pages: .stats, .svc-grid/.svc-card, .why-item, .step, .faq and .cta.
   The rules below add the page hero with breadcrumbs, the prose sections, the picture beside the first one and
   the card links. On a phone every card list is a readable vertical list (Rule 38), not the homepage rail. */
.page-hero {
  position: relative; display: flex; align-items: flex-end; min-height: clamp(480px, 66vh, 660px);
  padding: calc(120px + env(safe-area-inset-top)) 0 clamp(48px, 7vw, 88px); overflow: hidden; isolation: isolate;
  background: var(--purple-ink); color: #fff;
}
.page-hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(20, 10, 32, 0.88) 0%, rgba(20, 10, 32, 0.66) 50%, rgba(20, 10, 32, 0.3) 100%), linear-gradient(0deg, rgba(20, 10, 32, 0.55) 0%, rgba(20, 10, 32, 0) 55%);
}
.page-hero-plain { min-height: 0; background: linear-gradient(155deg, var(--purple-ink) 0%, var(--purple-deep) 60%, var(--purple) 100%); }
.page-hero-plain::before { display: none; }
.page-hero .eyebrow { margin: 22px 0 14px; color: var(--lilac); }
.page-hero h1 { max-width: 22ch; font-size: clamp(34px, 4.6vw, 60px); font-weight: 800; line-height: 1.06; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3); }
.page-hero-copy { max-width: 64ch; margin-top: 20px; }
.page-hero-copy > * + * { margin-top: 14px; }
.page-lead { font-size: clamp(16px, 1.3vw, 19px); font-weight: 500; line-height: 1.6; color: rgba(255, 255, 255, 0.93); }
.page-hero-note { font-size: 16px; line-height: 1.7; color: rgba(255, 255, 255, 0.9); }
.page-hero-copy a:not(.btn) { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.page-hero .cta-row { margin-top: 18px; }
.img-note {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  background: rgba(20, 10, 32, 0.6); color: rgba(255, 255, 255, 0.88); font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
}
.page-hero > .img-note { top: calc(92px + env(safe-area-inset-top)); bottom: auto; }
.svc-card > .img-note { top: 12px; bottom: auto; pointer-events: none; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; }
.crumbs li { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.78); }
.crumbs li + li::before { content: "/"; opacity: 0.55; }
.crumbs a { padding: 10px 0; margin: -10px 0; color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }

.page-sec { padding: var(--sec) 0; }
.sec-alt { background: var(--bg); }
.page-sec .sec-head { margin-bottom: 32px; }
.page-sec .sec-title { max-width: 26ch; }
.prose { max-width: 72ch; font-size: 16.5px; line-height: 1.7; color: #2b2833; }
.prose > * + * { margin-top: 14px; }
.prose h3 { margin-top: 26px; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--purple-ink); }
.prose strong { color: var(--ink); }
.prose a, .faq-item a, .sec-sub a { color: var(--purple); font-weight: 600; text-underline-offset: 3px; }
.checklist { display: grid; gap: 10px; padding: 0; list-style: none; }
.checklist li { position: relative; padding-left: 32px; }
.checklist li::before {
  content: "\2713"; position: absolute; left: 0; top: 0.2em; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--tint); color: var(--purple); font-size: 12px; font-weight: 800; line-height: 1;
}
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.split-media { position: relative; margin: 0; overflow: hidden; border-radius: 18px; }
.split-media img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.split-flip { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.split-flip > .split-media { order: -1; }

/* Card links: the whole card is one link, named by its heading */
.svc-card h3 a { color: #fff; text-decoration: none; }
.svc-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.svc-card:focus-within { outline: 2px solid var(--purple); outline-offset: 3px; }
.svc-card h3 a:focus-visible { outline: none; }
.svc-card:not(:has(img)) { background: linear-gradient(155deg, var(--purple-ink), var(--purple)); }
.page-cards .svc-card { min-height: 340px; }
/* The grid follows the card count (class nN): four in one row, five as three over two, never one card alone. */
@media (min-width: 1101px) {
  .page-cards.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .page-cards.n5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .page-cards.n5 > * { grid-column: span 2; }
  .page-cards.n5 > :nth-child(n + 4) { grid-column: span 3; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .page-cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.page-cards .svc-body p + p { margin-top: 8px; }
.svc-more { margin-top: 28px; }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.feature-grid .why-item h3 { font-size: 20px; }
.feature-grid .prose { font-size: 15.5px; }
.steps-list { max-width: 900px; margin: 0; padding: 0; list-style: none; }
.steps-list .step p { font-size: 16px; line-height: 1.6; color: var(--slate); }
.steps-list .step strong { color: var(--ink); }
.page-sec .prose + .steps-list, .steps-list + .prose { margin-top: 24px; }
.faq-item p + p, .faq-item p + ul { margin-top: -14px; }
.page-cta .cta-sub a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.page-cta .cta-sub + .cta-sub { margin-top: 14px; }
.page-forms .contact-forms { margin-top: 32px; }

/* Homepage: the borough pills and the footer's services column link to their pages */
.area-list a { display: block; margin: -12px -18px; padding: 12px 18px; border-radius: 999px; color: inherit; text-decoration: none; }
.area-list a:hover { background: var(--lilac); }
.footer-top { grid-template-columns: 1.6fr 1fr 1fr 1fr; }

@media (max-width: 1100px) {
  .split, .split-flip { grid-template-columns: minmax(0, 1fr); }
  .split-flip > .split-media { order: 0; }
  .split-media img { aspect-ratio: 16 / 10; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 899px) {
  .page-hero { min-height: 0; padding-top: calc(104px + env(safe-area-inset-top)); }
  .page-hero::before { background: linear-gradient(0deg, rgba(20, 10, 32, 0.92) 0%, rgba(20, 10, 32, 0.74) 60%, rgba(20, 10, 32, 0.5) 100%); }
  .page-hero > .img-note { top: calc(80px + env(safe-area-inset-top)); }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-cards { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; padding-bottom: 0; }
  .page-cards .svc-card { flex: none; min-height: 280px; }
}
