/* ==========================================================================
   Clearview Exterior Services - main stylesheet
   Auto dark/light via prefers-color-scheme. No external dependencies.
   ========================================================================== */

:root {
  /* Light mode: charcoal neutrals + single saturated blue accent.
     The blue is reserved for actions (CTAs, links, "Available now" badge).
     Everything else is greyscale. */
  --bg:          #fafafa;
  --bg-alt:      #ffffff;
  --bg-elev:     #ffffff;
  --surface:     #ffffff;
  --border:      #e5e7eb;
  --text:        #0f172a;
  --text-soft:   #475569;
  --text-mute:   #64748b;
  --neutral-1:   #f3f4f6;
  --neutral-2:   #d1d5db;
  --neutral-3:   #4b5563;
  --neutral-4:   #1f2937;
  --brand-light: #3b82f6;
  --brand:       #2563eb;
  --brand-2:     #1d4ed8;
  --brand-dark:  #1e3a8a;
  --brand-ink:   #ffffff;
  --accent:      #2563eb;
  --success:     #16a34a;
  --warn:        #c2410c;
  --error:       #b91c1c;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --max-w: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0a0a0b;
    --bg-alt:      #131316;
    --bg-elev:     #18181b;
    --surface:     #1a1a1d;
    --border:      #2a2a2e;
    --text:        #e5e7eb;
    --text-soft:   #a1a1aa;
    --text-mute:   #71717a;
    --neutral-1:   #1f1f23;
    --neutral-2:   #3f3f46;
    --neutral-3:   #a1a1aa;
    --neutral-4:   #e5e7eb;
    --brand-light: #60a5fa;
    --brand:       #60a5fa;
    --brand-2:     #3b82f6;
    --brand-dark:  #1d4ed8;
    --brand-ink:   #0a0a0b;
    --accent:      #60a5fa;
    --success:     #4ade80;
    --warn:        #fb923c;
    --error:       #f87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.65), 0 4px 8px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img { display: block; max-width: 100%; }

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; color: var(--text); }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { color: var(--text-soft); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-alt) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 6px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-tag  { font-size: 0.75rem; color: var(--text-mute); }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.site-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav .cta-link {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.site-nav .cta-link:hover { background: var(--brand-2); }

@media (max-width: 720px) {
  .site-nav { gap: 0.75rem; }
  .site-nav a:not(.cta-link) { display: none; }
}

/* Hero */
.hero {
  padding: clamp(3rem, 7vw, 6rem) 1.5rem;
  background:
    linear-gradient(180deg, var(--neutral-1) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 { margin-bottom: 1rem; }
.lead   { font-size: 1.1rem; color: var(--text-soft); max-width: 60ch; }
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0.75rem;
}
.hero-note { font-size: 0.9rem; color: var(--text-mute); margin: 0; }

.hero-art { position: relative; min-height: 220px; }
.hero-window {
  position: relative;
  margin-left: auto;
  width: min(360px, 100%);
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #3b82f6 0%, #1e3a8a 100%);
  border: 6px solid var(--bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  overflow: hidden;
  opacity: 0.85;
}
.hero-window-pane {
  background: linear-gradient(160deg,
    color-mix(in srgb, #ffffff 22%, transparent) 0%,
    transparent 70%);
  border-radius: 3px;
}
.hero-shine {
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60%;
  height: 130%;
  background: linear-gradient(120deg,
    transparent 42%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 58%);
  transform: rotate(20deg);
  pointer-events: none;
  border-radius: var(--radius-lg);
}
@media (prefers-color-scheme: dark) {
  /* Dimmer sheen on dark backgrounds; pure white would be glare-bright. */
  .hero-shine {
    background: linear-gradient(120deg,
      transparent 42%,
      rgba(255, 255, 255, 0.18) 50%,
      transparent 58%);
  }
}
@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border 120ms ease, color 120ms ease, transform 120ms ease;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
}
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-alt); border-color: var(--text-mute); }
.btn-lg { padding: 0.9rem 1.5rem; font-size: 1.05rem; }

/* Sections */
.section { padding: clamp(3rem, 6vw, 5rem) 1.5rem; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-lead { color: var(--text-soft); max-width: 60ch; }

/* Cards */
.cards {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;            /* image is flush to the edge; inner content gets its own padding */
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, box-shadow 150ms ease, border 150ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Service cards: identical structure regardless of active/coming-soon. */
.card-service > .badge,
.card-service > h3,
.card-service > p { margin-left: 1.25rem; margin-right: 1.25rem; }
.card-service > .badge { margin-top: 1rem; align-self: flex-start; }
.card-service > h3     { margin-top: 0.6rem; margin-bottom: 0.4rem; }
.card-service > p      { margin-top: 0; margin-bottom: 1.25rem; color: var(--text-soft); }

/* Image slot: sits at the top of every service card. If the matching PNG in
   /static/img/services/ doesn't exist yet, <img> removes itself on error and
   the placeholder gradient on this wrapper shows through. */
.card-art {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, var(--neutral-1) 0%, var(--neutral-2) 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.card-art::after {
  /* Subtle "image will go here" hint visible only when the <img> is missing. */
  content: "";
  position: absolute;
  inset: 30% 30%;
  border: 2px dashed color-mix(in srgb, var(--text-mute) 50%, transparent);
  border-radius: var(--radius-sm);
  opacity: 0.5;
}
.card-art-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* If the image successfully loads it covers the placeholder hint. */
.card-art:has(.card-art-img)::after { display: none; }

/* Coming-soon variant: same structure, just slightly dimmed art + neutral badge. */
.card-soon .card-art   { opacity: 0.85; filter: grayscale(0.15); }
.card-soon h3          { color: var(--text-soft); }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge-active {
  background: var(--brand);
  color: var(--brand-ink);
}
.badge-soon {
  background: var(--neutral-1);
  color: var(--neutral-3);
  border: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  .badge-soon { background: var(--neutral-1); color: var(--neutral-3); border-color: var(--border); }
}

/* Gallery */
.gallery {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.gallery-item figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.gallery-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.gallery-placeholder {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--neutral-1) 0%, var(--neutral-2) 100%);
  position: relative;
}
.gallery-placeholder::after {
  content: "";
  position: absolute;
  inset: 12% 12% 12% 12%;
  border: 6px solid var(--bg-alt);
  border-radius: 4px;
  background:
    linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%),
    linear-gradient(160deg,
      color-mix(in srgb, #ffffff 30%, transparent) 0%,
      color-mix(in srgb, #ffffff 6%, transparent) 60%,
      transparent 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.gp-1::after { transform: rotate(-1deg); }
.gp-2::after { transform: rotate(1deg); }
.gp-3::after { transform: rotate(-2deg); }
.gp-4::after { transform: rotate(2deg); }
.gp-5::after { transform: rotate(0deg); }
.gp-6::after { transform: rotate(-1deg); }
.gallery-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-mute);
}
.gallery-note code {
  background: var(--bg-alt);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.85em;
}

/* CTA banner: deep navy in both themes. Locked colors so contrast never breaks
   regardless of light/dark mode swapping --brand-ink. */
.section-cta {
  background: linear-gradient(135deg, #1e40af 0%, #172554 100%);
  border-top: 0;
  border-bottom: 0;
  color: #ffffff;
}
.section-cta h2 { color: #ffffff; }
.section-cta p  { color: rgba(255, 255, 255, 0.82); }
.section-cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.section-cta .btn-primary {
  background: #ffffff;
  color: #1e3a8a;
  border: 1px solid transparent;
}
.section-cta .btn-primary:hover {
  background: #f3f4f6;
  color: #1e3a8a;
}
.section-cta .btn-lg { margin-top: 1rem; }

/* Contact */
.contact-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}
.contact-list { list-style: none; padding: 0; margin: 1rem 0 0; line-height: 2; }

.payment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.payment-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.payment-timing {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-weight: 500;
}
.payment-methods {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.payment-methods li {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.payment-notes {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

@media (max-width: 700px) {
  .contact-inner { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 1.5rem;
  align-items: center;
}
.footer-brand { display: flex; gap: 0.75rem; align-items: center; }
.footer-logo { height: 40px; width: 40px; object-fit: contain; border-radius: 6px; }
.footer-name { font-weight: 700; }
.footer-meta { font-size: 0.9rem; color: var(--text-mute); }
.footer-contact { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.95rem; }
.footer-copy { font-size: 0.85rem; color: var(--text-mute); text-align: right; }
.footer-admin-link { color: var(--text-mute); margin-left: 0.5rem; font-size: 0.8rem; opacity: 0.6; }
.footer-admin-link:hover { color: var(--text-soft); opacity: 1; }
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; text-align: left; }
  .footer-copy { text-align: left; }
}

/* ==========================================================================
   Quote page
   ========================================================================== */

.quote-page { padding: 2rem 1.5rem 4rem; background: var(--bg); }
.quote-shell {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.quote-header h1 { margin-bottom: 0.5rem; }
.quote-header p  { color: var(--text-soft); }

.quote-notice {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--accent, #2c8cff);
  background: color-mix(in srgb, var(--accent, #2c8cff) 10%, transparent);
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-strong, inherit);
}
.quote-notice strong { letter-spacing: 0.01em; }

.step-indicator {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  counter-reset: step;
}
.step-indicator li {
  flex: 1 1 0;
  min-width: 120px;
  padding: 0.6rem 0.8rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}
.step-indicator li::before {
  content: counter(step) ". ";
  counter-increment: step;
  font-weight: 700;
  color: var(--text-soft);
}
.step-indicator li.active {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--text);
}
.step-indicator li.done {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--text);
}

.step { margin-top: 2rem; }
.step h2 { margin-bottom: 0.5rem; }

.card-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field label, .field legend { font-weight: 600; font-size: 0.95rem; color: var(--text); padding: 0; }
.field .help { font-size: 0.85rem; color: var(--text-mute); margin: 0; }
.field input, .field textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

/* Address autocomplete dropdown */
.address-search { position: relative; }
.address-suggestions {
  list-style: none;
  margin: 4px 0 0;
  padding: 0.25rem 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 280px;
  overflow-y: auto;
}
.address-suggestion {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}
.address-suggestion + .address-suggestion {
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.address-suggestion:hover,
.address-suggestion.active {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--text);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.45;
}
.checkbox input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.size-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.size-options > p.help {
  /* Loading / empty states span the whole container so they sit centred. */
  grid-column: 1 / -1;
  text-align: center;
  margin: 0;
}
#size-total { text-align: center; }
.size-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border 120ms ease, transform 120ms ease;
}
.size-card:focus-within { border-color: var(--brand); }
.size-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--surface);
}
.size-photo-empty {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 22%, var(--bg-alt)),
    color-mix(in srgb, var(--accent) 12%, var(--bg-alt)));
  position: relative;
}
.size-photo-empty::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 5px solid var(--bg-alt);
  border-radius: 4px;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
}
.size-body { padding: 0.75rem 0.9rem 0.9rem; display: flex; flex-direction: column; gap: 0.4rem; }
.size-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.size-name { margin: 0; font-size: 1rem; }
.size-price { font-size: 0.85rem; color: var(--text-mute); font-weight: 600; }
.size-desc { margin: 0; font-size: 0.85rem; color: var(--text-soft); }
.size-counter {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
}
.size-counter button.size-step {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.size-counter button.size-step:hover { border-color: var(--brand); }
.size-counter input[type="number"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  text-align: center;
  /* hide spinner arrows */
  -moz-appearance: textfield;
}
.size-counter input[type="number"]::-webkit-outer-spin-button,
.size-counter input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.size-total {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
}

#phone-match-status.ok { color: var(--accent); }
#phone-match-status.err { color: var(--error); }

.service-options {
  display: grid;
  gap: 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.service-options label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-weight: 500;
  color: var(--text);
}
.service-options label small { color: var(--text-mute); font-weight: 400; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.error { color: var(--error); margin: 0; }
.warning { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
.muted { color: var(--text-mute); }

.quote-result {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-alt));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: var(--radius);
}
.estimate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 0;
}
@media (max-width: 540px) { .estimate-grid { grid-template-columns: 1fr; } }
.estimate-figure {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.estimate-label { font-size: 0.85rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.04em; }
.estimate-value { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; color: var(--text); }
.quote-fineprint { font-size: 0.85rem; color: var(--text-mute); margin: 0.5rem 0 1rem; }
.estimate-disclaimer {
  margin: 0.25rem 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--warn, #d9a300);
  background: color-mix(in srgb, var(--warn, #d9a300) 12%, transparent);
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Calendar-style time picker: horizontally scrollable day strip on top,
   grid of times below for the selected day. Replaces a flat list of every
   slot for the next 21 days. */
.calendar {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  overflow: hidden;
}
.calendar-days {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  scrollbar-width: thin;
}
.calendar-day {
  flex: 0 0 auto;
  min-width: 78px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border 120ms ease, background 120ms ease, transform 80ms ease;
}
.calendar-day:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}
.calendar-day.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
}
.calendar-day-weekday {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
}
.calendar-day-date {
  font-size: 1rem;
  font-weight: 700;
}
.calendar-day-count {
  font-size: 0.7rem;
  color: var(--text-mute);
}
.calendar-day-body {
  padding: 0.9rem 0.9rem 1rem;
}
.calendar-day-label {
  margin: 0 0 0.6rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
.calendar-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}
.calendar-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border 120ms ease, background 120ms ease;
}
.calendar-slot:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.calendar-slot.selected {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 20%, var(--surface));
}

/* "How we estimated the time" breakdown */
.time-breakdown {
  margin: 0.75rem 0 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
}
.time-breakdown > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  padding: 0.25rem 0;
  user-select: none;
}
.time-breakdown[open] > summary { color: var(--text); }
.time-breakdown-list {
  list-style: none;
  padding: 0.4rem 0 0.2rem;
  margin: 0;
  display: grid;
  gap: 0.25rem;
}
.time-breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.time-breakdown-list li strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
.summary dt { color: var(--text-mute); font-size: 0.85rem; }
.summary dd { margin: 0; color: var(--text); }

.verify-block {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.verify-block .form-actions { justify-content: flex-start; }
.verify-status { margin: 0 0 0.5rem; font-weight: 500; }
.verify-status.ok { color: var(--accent); }
.verify-status.err { color: var(--error); }

.terms-block { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }

.done {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.confirmation-notice {
  margin: 1.5rem 0 1rem;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--brand) 8%, var(--bg-alt));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* ---- Availability section ---- */
#availability { padding: 4rem 1rem; }
#availability > .section-inner { max-width: 960px; }
#availability h2 { margin-bottom: 0.5rem; }

.availability-intro {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--brand) 6%, var(--bg-alt));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.6;
}
.availability-intro strong { color: var(--text); }
.availability-intro a { color: var(--brand); font-weight: 600; text-decoration: none; }
.availability-intro a:hover { text-decoration: underline; }

.availability-container {
  margin-top: 1rem;
}
#availability-loading,
#availability-error {
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-soft);
  font-size: 0.95rem;
}
#availability-error { color: var(--text); }

.availability-calendar {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.availability-days {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 50%, var(--bg-alt));
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.availability-days::-webkit-scrollbar { height: 8px; }
.availability-days::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

button.availability-day {
  flex: 0 0 auto;
  min-width: 92px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
  box-shadow: var(--shadow-sm);
}
button.availability-day:hover {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
button.availability-day.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}
.availability-day-weekday {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  font-weight: 600;
}
.availability-day-date {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin: 0.15rem 0;
}
.availability-day-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  font-weight: 500;
}
.availability-day-count {
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 600;
  margin-top: 0.25rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border);
}
button.availability-day.active .availability-day-count { color: var(--brand); }

.availability-day-body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.availability-day-label {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.availability-day-label-main {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}
.availability-day-label-count {
  font-size: 0.85rem;
  color: var(--brand);
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-radius: 999px;
}
.availability-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}
.availability-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 120ms ease;
  box-shadow: var(--shadow-sm);
}
.availability-slot:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.availability-slot-time {
  font-weight: 700;
  color: var(--text);
}
.availability-slot-divider {
  color: var(--text-mute);
  font-size: 0.85rem;
}
.availability-slot-end {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  button.availability-day { min-width: 80px; padding: 0.6rem 0.7rem; }
  .availability-day-date { font-size: 1.25rem; }
  .availability-day-body { padding: 1rem; }
  .availability-times { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
