/* ==========================================================================
   RainGuard Gutter Systems — Scandinavian minimal, storm-gray + rain-blue
   ========================================================================== */

:root {
  --ink: #212a30;
  --slate-700: #3f4a52;
  --slate-500: #6b7981;
  --slate-300: #b7c2c7;
  --slate-200: #d7dfe2;
  --slate-100: #eef2f3;
  --slate-50: #f6f8f9;
  --rain-600: #3c6d8c;
  --rain-500: #4f84a4;
  --rain-100: #e6eff4;
  --white: #ffffff;
  --line: #dbe2e5;
  --radius: 3px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Georgia", "Iowan Old Style", "Times New Roman", serif;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--ink);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); font-weight: 400; }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
h3 { font-size: 1.25rem; font-family: var(--font-body); font-weight: 600; }

p { margin: 0 0 var(--space-2); color: var(--slate-700); }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rain-600);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: var(--space-1) var(--space-2);
  z-index: 200;
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* ---------------- Header ---------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  max-width: var(--max);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.28rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.logo:hover { text-decoration: none; }
.logo .mark { flex-shrink: 0; }
.logo strong { font-weight: 400; }
.logo .tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-top: 2px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.main-nav ul {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--slate-700);
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: var(--rain-500);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.header-phone {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  white-space: nowrap;
}
.header-phone:hover { text-decoration: none; color: var(--rain-600); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--rain-600);
  color: var(--white);
  border-color: var(--rain-600);
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--slate-300);
}
.btn-outline:hover { border-color: var(--ink); background: var(--slate-50); }

.btn-inverse {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}
.btn-inverse:hover { background: transparent; color: var(--white); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: linear-gradient(155deg, var(--slate-50) 0%, var(--rain-100) 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.rain-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6) var(--space-3);
  max-width: var(--max);
  margin: 0 auto;
}
.hero-copy p.lede {
  font-size: 1.1rem;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
.hero-note {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--slate-500);
}
.hero-art { position: relative; }

/* ---------------- Stats / trust bar ---------------- */
.trust-bar {
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: var(--space-4) 0;
}
.trust-item {
  text-align: center;
  padding: 0 var(--space-2);
  border-left: 1px solid var(--line);
}
.trust-item:first-child { border-left: none; }
.trust-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--rain-600);
  display: block;
}
.trust-label {
  font-size: 0.82rem;
  color: var(--slate-500);
  letter-spacing: 0.03em;
}

/* ---------------- Sections ---------------- */
section { padding: var(--space-6) 0; }
.section-head {
  max-width: 62ch;
  margin: 0 0 var(--space-4);
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.alt { background: var(--slate-50); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Card grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--white);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--rain-500); transform: translateY(-2px); }
.card .icon { margin-bottom: var(--space-2); color: var(--rain-600); }
.card h3 { margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; margin-bottom: var(--space-2); }
.card .link { font-size: 0.88rem; font-weight: 600; }

/* Why choose us */
.reasons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-4);
}
.reason {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.reason .num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--slate-300);
  line-height: 1;
  min-width: 2.2rem;
}
.reason h3 { margin-bottom: 0.3rem; font-size: 1.05rem; }
.reason p { font-size: 0.93rem; margin-bottom: 0; }

/* Testimonials */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.testimonial {
  margin: 0;
  border-top: 2px solid var(--rain-500);
  padding-top: var(--space-2);
  background: var(--white);
}
.testimonial p { font-style: italic; color: var(--slate-700); }
.testimonial .stars { color: var(--rain-600); letter-spacing: 0.1em; margin-bottom: var(--space-1); font-size: 0.9rem; }
.testimonial .who { font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.testimonial .where { font-size: 0.8rem; color: var(--slate-500); }

/* CTA banner */
.cta-banner {
  background: var(--ink);
  color: var(--white);
  text-align: center;
  padding: var(--space-5) var(--space-3);
}
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: var(--slate-300); max-width: 50ch; margin-left: auto; margin-right: auto; }
.cta-banner .hero-actions { justify-content: center; }

/* Service area teaser */
.area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
}
.area-list li {
  font-size: 0.92rem;
  color: var(--slate-700);
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------------- Services page ---------------- */
.services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.service-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.service-block .icon { color: var(--rain-600); margin-bottom: var(--space-2); }
.service-block h2 { font-size: 1.4rem; }

/* ---------------- About page ---------------- */
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: center;
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.value-card {
  padding: var(--space-3);
  border-left: 3px solid var(--rain-500);
  background: var(--slate-50);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.team-card { text-align: center; }
.avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--rain-100);
  color: var(--rain-600);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 auto var(--space-2);
  border: 1px solid var(--rain-500);
}
.team-card h3 { margin-bottom: 0.15rem; }
.team-role { font-size: 0.85rem; color: var(--rain-600); margin-bottom: var(--space-1); font-weight: 600; }
.team-bio { font-size: 0.9rem; }

.cert-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
.cert-list li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.94rem;
  color: var(--slate-700);
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cert-list svg { flex-shrink: 0; color: var(--rain-600); margin-top: 2px; }

/* ---------------- Service areas page ---------------- */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.areas-grid li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2);
  font-weight: 600;
  font-size: 0.95rem;
}
.area-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.area-detail {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.area-detail h3 { color: var(--rain-600); font-family: var(--font-display); font-size: 1.2rem; }

/* ---------------- Contact page ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--space-5);
}
.contact-info-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
}
.contact-info-list li {
  display: flex;
  gap: 0.8rem;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.96rem;
}
.contact-info-list svg { color: var(--rain-600); flex-shrink: 0; margin-top: 2px; }

table.hours {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-2);
}
table.hours th, table.hours td {
  text-align: left;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}
table.hours th { color: var(--slate-500); font-weight: 500; }

.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--slate-50);
}
.form-row { margin-bottom: var(--space-2); }
.form-row label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--ink);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--rain-600);
  outline-offset: 1px;
  border-color: var(--rain-600);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--ink);
  color: var(--slate-300);
  padding: var(--space-5) 0 var(--space-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid #3a444b;
}
.footer-grid h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.55rem; font-size: 0.92rem; }
.footer-grid a { color: var(--slate-300); }
.footer-grid a:hover { color: var(--white); }
.footer-logo {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: var(--space-2);
}
.footer-nap p { color: var(--slate-300); font-size: 0.92rem; margin-bottom: 0.3rem; }
.footer-social { display: flex; gap: 0.7rem; margin-top: var(--space-2); }
.footer-social a {
  width: 34px; height: 34px;
  border: 1px solid #4a545c;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-300);
}
.footer-social a:hover { border-color: var(--white); color: var(--white); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: var(--space-3);
  font-size: 0.82rem;
  color: var(--slate-500);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: var(--space-5); padding-bottom: var(--space-5); }
  .hero-art { order: -1; max-width: 340px; margin: 0 auto; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); row-gap: var(--space-3); }
  .trust-item:nth-child(3) { border-left: none; }
  .card-grid, .reasons, .testimonial-grid, .values-grid, .team-grid,
  .services-list, .area-detail-grid, .cert-list { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr; }
  .areas-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: none;
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: var(--space-2); }
  .nav-toggle { display: inline-flex; }
  .header-phone { display: none; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Booking / Client Portal / Instant Estimate — added for online scheduling,
   client account, and quote-builder pages. Append-only: does not alter any
   rule above. New design tokens are added via a second :root block so the
   original token list stays untouched.
   ========================================================================== */

:root {
  --amber-600: #92500f;
  --amber-100: #fbeee0;
  --danger-600: #b23b3b;
}

/* ---- Small "Demo" footer note ---- */
.demo-note {
  flex-basis: 100%;
  font-size: 0.76rem;
  color: var(--slate-500);
  opacity: 0.85;
  margin-top: var(--space-1);
}

/* ---- Nav: room for Get Estimate / Client Portal links + Book Now button ---- */
.main-nav ul { gap: var(--space-2); }
.main-nav a { font-size: 0.85rem; }

@media (max-width: 1180px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: none;
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: var(--space-2); }
  .main-nav a { font-size: 0.98rem; }
  .nav-toggle { display: inline-flex; }
  .header-phone { display: none; }
}

/* ---- Generic app shell used by booking / estimate / portal ---- */
.app-shell { max-width: 880px; margin: 0 auto; }
.app-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: var(--space-4);
}

/* ---- Step indicator (booking) ---- */
.step-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-3);
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}
.step-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--slate-500);
  font-weight: 600;
}
.step-list .num {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--slate-300);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--slate-500);
  flex-shrink: 0;
}
.step-list li.is-active { color: var(--ink); }
.step-list li.is-active .num { border-color: var(--rain-600); color: var(--rain-600); }
.step-list li.is-done { color: var(--rain-600); }
.step-list li.is-done .num { background: var(--rain-600); border-color: var(--rain-600); color: var(--white); }

/* ---- Calendar ---- */
.calendar-panel { margin-bottom: var(--space-4); }
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.calendar-head h2 { margin-bottom: 0; font-size: 1.15rem; }
.calendar-legend {
  display: flex;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}
.calendar-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-dot.available { background: var(--rain-500); }
.legend-dot.unavailable { background: var(--slate-200); }
.legend-dot.selected { background: var(--ink); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}
.calendar-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate-500);
  padding-bottom: 0.3rem;
}
.calendar-day {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.calendar-day:hover:not(:disabled) { border-color: var(--rain-600); background: var(--rain-100); }
.calendar-day:disabled {
  color: var(--slate-300);
  background: var(--slate-50);
  border-color: var(--slate-100);
  cursor: not-allowed;
  text-decoration: line-through;
}
.calendar-day.is-empty { border: none; background: none; cursor: default; }
.calendar-day.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  font-weight: 600;
}

/* ---- Time slots ---- */
.slot-panel { margin-bottom: var(--space-4); }
.slot-panel h2 { font-size: 1.15rem; }
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
}
.slot-btn {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  background: var(--white);
  padding: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
.slot-btn:hover { border-color: var(--rain-600); background: var(--rain-100); }
.slot-btn.is-selected { background: var(--rain-600); border-color: var(--rain-600); color: var(--white); }

/* ---- Confirmation screens (booking + payment + deposit) ---- */
.confirm-panel { text-align: center; padding: var(--space-4) 0; }
.confirm-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--rain-100);
  border: 1px solid var(--rain-500);
  color: var(--rain-600);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-3);
  animation: confirm-pop 0.4s ease;
}
.confirm-ref {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--rain-600);
  margin: var(--space-2) 0;
  letter-spacing: 0.02em;
}
.confirm-detail { color: var(--slate-700); margin-bottom: var(--space-3); }
.next-steps {
  text-align: left;
  max-width: 46ch;
  margin: var(--space-3) auto 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.next-steps li {
  counter-increment: step;
  display: flex;
  gap: 0.8rem;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  color: var(--slate-700);
}
.next-steps li:first-child { border-top: none; }
.next-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--rain-100);
  color: var(--rain-600);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

@keyframes confirm-pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .confirm-icon { animation: none; }
}

[hidden] { display: none !important; }

/* ---- Login screen (portal) ---- */
.login-shell { max-width: 400px; margin: 0 auto; }
.login-shell .app-card { text-align: left; }
.login-shell h2 { font-size: 1.4rem; }
.demo-account-btn { width: 100%; margin-top: var(--space-2); }
.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0;
  color: var(--slate-500);
  font-size: 0.8rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- Portal dashboard ---- */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.portal-header p { margin-bottom: 0; }
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.portal-grid .span-2 { grid-column: 1 / -1; }
.portal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  background: var(--white);
}
.portal-card h2 { font-size: 1.1rem; margin-bottom: var(--space-2); }
.appt-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}
.appt-item:first-of-type { border-top: none; }
.appt-item .when { font-weight: 600; color: var(--ink); font-size: 0.92rem; margin-bottom: 0.2rem; }
.appt-item .what { font-size: 0.88rem; color: var(--slate-500); margin-bottom: 0; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 0.55rem 0.3rem;
  border-bottom: 1px solid var(--line);
}
table.data-table th { color: var(--slate-500); font-weight: 500; font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-paid { background: var(--rain-100); color: var(--rain-600); }
.badge-due { background: var(--amber-100); color: var(--amber-600); }
.badge-completed { background: var(--slate-100); color: var(--slate-700); }
.badge-scheduled { background: var(--rain-100); color: var(--rain-600); }

.invoice-block { border-top: 1px solid var(--line); padding-top: var(--space-2); margin-top: var(--space-2); }
.invoice-block:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.invoice-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: 0.4rem; flex-wrap: wrap; }
.invoice-head strong { font-size: 0.98rem; }
.invoice-lines { list-style: none; padding: 0; margin: 0.5rem 0; font-size: 0.86rem; }
.invoice-lines li { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0.3rem 0; color: var(--slate-700); }
.invoice-total { display: flex; justify-content: space-between; font-weight: 700; padding-top: 0.4rem; border-top: 1px dashed var(--line); color: var(--ink); }

.segmented {
  display: flex;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-2) 0;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  border-left: 1px solid var(--slate-300);
}
.segmented label:first-of-type { border-left: none; }
.segmented input:checked + label { background: var(--rain-600); color: var(--white); }
.segmented input:focus-visible + label { outline: 2px solid var(--rain-600); outline-offset: -2px; }

.plan-detail { font-size: 0.9rem; color: var(--slate-700); margin-bottom: 0; }
.plan-detail strong { color: var(--ink); }
.plan-price { font-family: var(--font-display); font-size: 1.6rem; color: var(--rain-600); margin: 0.3rem 0; }

.account-list { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.account-list li { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.account-list li:last-child { border-bottom: none; }
.account-list li span:first-child { color: var(--slate-500); }
.account-list li span:last-child { color: var(--ink); font-weight: 600; text-align: right; }

/* ---- Payment modal (shared: portal + estimate) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 42, 48, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 300;
}
.modal-dialog {
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--space-4);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--slate-500);
  padding: 0.3rem;
}
.modal-close:hover { color: var(--ink); }
.modal-title { display: flex; align-items: center; gap: 0.6rem; margin-bottom: var(--space-1); }
.modal-title svg { color: var(--rain-600); flex-shrink: 0; }
.trust-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--slate-500);
  margin: var(--space-2) 0 var(--space-3);
}
.trust-note svg { color: var(--rain-600); flex-shrink: 0; }
.card-number-group { position: relative; }
.card-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.field-error {
  font-size: 0.8rem;
  color: var(--danger-600);
  margin-top: 0.3rem;
  margin-bottom: 0;
  display: none;
}
.form-row.has-error input { border-color: var(--danger-600); }
.form-row.has-error .field-error { display: block; }

.pay-amount {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--ink);
  text-align: center;
  margin: var(--space-1) 0 var(--space-3);
}

.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--rain-100);
  border-top-color: var(--rain-600);
  border-radius: 50%;
  margin: var(--space-3) auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

.pay-processing, .pay-success { text-align: center; padding: var(--space-2) 0; }
.pay-success .confirm-icon { margin-bottom: var(--space-2); }

/* ---- Estimate builder ---- */
.estimate-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
.stepper-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.stepper-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--slate-300);
  background: var(--white);
  border-radius: var(--radius);
  font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}
.stepper-btn:hover { border-color: var(--rain-600); color: var(--rain-600); }
input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--slate-200);
  accent-color: var(--rain-600);
  cursor: pointer;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 0.3rem;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  background: var(--slate-50);
  margin-bottom: var(--space-2);
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: 999px;
  transition: background 0.15s ease;
  pointer-events: none;
}
.toggle-track::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.toggle-switch input:checked + .toggle-track { background: var(--rain-600); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-track { outline: 2px solid var(--rain-600); outline-offset: 2px; }

.price-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--slate-50);
  padding: var(--space-4);
  position: sticky;
  top: calc(var(--space-5) + 60px);
}
.price-range {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--rain-600);
  margin: var(--space-1) 0;
}
.price-breakdown {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
}
.price-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--slate-700);
}
.price-breakdown li:last-child { border-bottom: none; font-weight: 700; color: var(--ink); }
.disclaimer { font-size: 0.8rem; color: var(--slate-500); margin-top: var(--space-2); margin-bottom: 0; }
.deposit-panel { margin-top: var(--space-5); }

/* ---- Responsive: booking/portal/estimate ---- */
@media (max-width: 900px) {
  .estimate-layout { grid-template-columns: 1fr; }
  .price-panel { position: static; }
  .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .calendar-grid { gap: 0.25rem; }
  .calendar-day { font-size: 0.78rem; }
  .card-row-2 { grid-template-columns: 1fr; }
  .step-list { gap: var(--space-1) var(--space-3); }
  .invoice-head { flex-direction: column; align-items: flex-start; }
}
