/* =========================================================
   ClearView Window Cleaning — Design System
   Airy / light / glassmorphism / sun & sparkle motifs
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* color: sky palette */
  --sky-900: #123049;
  --sky-800: #164060;
  --sky-700: #1c6f9c;
  --sky-600: #2b96c9;
  --sky-500: #4fb3e8;
  --sky-400: #7cc9f0;
  --sky-300: #a9dcf6;
  --sky-200: #cdeafb;
  --sky-100: #e7f6fd;
  --sky-50:  #f5fbff;

  --gold-500: #f5b942; /* sun accent */
  --gold-300: #ffd479;

  --white: #ffffff;

  /* text */
  --ink: #16324a;        /* headings */
  --ink-body: #24475c;   /* body copy, AA-safe on light bg */
  --ink-muted: #4c6f85;  /* secondary text, still AA on white */
  --ink-on-dark: #eef8ff;

  /* surfaces */
  --bg: #f6fbff;
  --bg-alt: #eef8fe;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 14px 34px rgba(19, 74, 107, 0.14);

  /* spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3.5rem;
  --sp-9: 5rem;
  --sp-10: 7rem;

  /* radius */
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-full: 999px;

  /* type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", var(--font-body);

  --container: 1180px;

  /* motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
a { color: inherit; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink-body);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { max-width: 68ch; }
p.lead { font-size: 1.15rem; color: var(--ink-muted); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

section { padding-block: var(--sp-9); position: relative; }
section.tight { padding-block: var(--sp-8); }

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sky-700);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  background: var(--sky-900);
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-sm);
  z-index: 1000;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------- Glass component ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, 0.92); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--r-full);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  color: #fff;
  box-shadow: 0 10px 24px rgba(28, 111, 156, 0.35);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(28, 111, 156, 0.42); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.75);
  color: var(--sky-800);
  border-color: var(--sky-300);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: #fff; border-color: var(--sky-500); }
.btn-ghost-light {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.24); }
.btn-block { width: 100%; justify-content: center; }

.link-inline {
  color: var(--sky-700);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-inline:hover { color: var(--sky-900); }

/* ---------- Header ---------- */
.topbar {
  background: var(--sky-900);
  color: var(--ink-on-dark);
  font-size: 0.85rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding-block: 0.45rem;
  flex-wrap: wrap;
}
.topbar a { color: var(--ink-on-dark); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.topbar-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 251, 255, 0.78);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(79, 179, 232, 0.22);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--sp-3);
  gap: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand-sub { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sky-700); font-weight: 700; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  border: 1px solid var(--sky-300);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; color: var(--sky-800); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}
.primary-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-body);
  font-size: 0.98rem;
  padding-block: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.primary-nav a:hover { color: var(--sky-800); }
.primary-nav a[aria-current="page"] {
  color: var(--sky-800);
  border-bottom-color: var(--sky-500);
}
.nav-cta {
  background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  color: #fff !important;
  padding: 0.55rem 1.2rem;
  border-radius: var(--r-full);
  border-bottom: none !important;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: rgba(246, 251, 255, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(79, 179, 232, 0.25);
    box-shadow: 0 18px 30px rgba(19, 74, 107, 0.14);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s var(--ease);
  }
  .primary-nav.is-open { max-height: 480px; }
  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-3) var(--sp-5) var(--sp-5);
  }
  .primary-nav li { border-bottom: 1px solid rgba(79, 179, 232, 0.15); }
  .primary-nav a { display: block; padding: 0.9rem 0.2rem; }
  .nav-cta { display: inline-block; margin-top: var(--sp-3); text-align: center; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at 15% 15%, var(--sky-100), var(--bg) 55%);
  overflow: hidden;
  padding-block: var(--sp-9) var(--sp-9);
}
.hero .container {
  display: grid;
  gap: var(--sp-8);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .hero .container { grid-template-columns: 1.05fr 0.95fr; }
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79, 179, 232, 0.14);
  color: var(--sky-800);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-full);
  margin-bottom: var(--sp-4);
}
.hero h1 { margin-bottom: var(--sp-4); }
.hero-lead { font-size: 1.15rem; color: var(--ink-muted); margin-bottom: var(--sp-6); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  font-size: 0.92rem;
  color: var(--ink-muted);
  font-weight: 600;
}
.hero-trust li { display: flex; align-items: center; gap: 0.45rem; }
.hero-trust svg { width: 18px; height: 18px; color: var(--sky-700); flex-shrink: 0; }
.hero-art { position: relative; }

/* ---------- Stats / trust bar ---------- */
.stat-bar {
  padding-block: var(--sp-8);
}
.stat-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
}
.stat-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--sky-800);
  display: block;
}
.stat-label { font-size: 0.88rem; color: var(--ink-muted); font-weight: 600; margin-top: 0.25rem; }

/* ---------- Section headings ---------- */
.section-head { max-width: 62ch; margin-bottom: var(--sp-7); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-weight: 800;
  color: var(--sky-700);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: var(--sp-2);
}

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }

.feature-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.feature-card:hover { transform: translateY(-4px); }
.icon-badge {
  width: 58px;
  height: 58px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--sky-200), var(--sky-100));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-badge svg { width: 30px; height: 30px; color: var(--sky-800); }
.feature-card h3 { margin-bottom: 0.1rem; }
.feature-card p { color: var(--ink-muted); font-size: 0.98rem; }
.feature-card .card-link { margin-top: auto; font-weight: 700; color: var(--sky-700); text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.feature-card .card-link:hover { color: var(--sky-900); }

/* ---------- Why choose us ---------- */
.why-list { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .why-list { grid-template-columns: repeat(2, 1fr); } }
.why-item { display: flex; gap: var(--sp-4); align-items: flex-start; }
.why-item .icon-badge { width: 48px; height: 48px; }
.why-item .icon-badge svg { width: 24px; height: 24px; }
.why-item h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.why-item p { color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- Testimonials ---------- */
.testimonial-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.stars { display: flex; gap: 0.15rem; }
.stars svg { width: 18px; height: 18px; color: var(--gold-500); }
.testimonial-card blockquote { margin: 0; font-size: 1rem; color: var(--ink-body); font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 0.7rem; margin-top: auto; }
.testimonial-author .avatar { width: 40px; height: 40px; border-radius: 50%; }
.testimonial-name { font-weight: 700; font-size: 0.92rem; color: var(--ink); }
.testimonial-loc { font-size: 0.82rem; color: var(--ink-muted); }

/* ---------- Divider ---------- */
.sparkle-divider { position: relative; height: 64px; overflow: hidden; }
.sparkle-divider svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(120deg, var(--sky-800), var(--sky-900) 70%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cta-banner h2, .cta-banner p { color: #fff; }
.cta-banner p { color: rgba(255, 255, 255, 0.85); margin-inline: auto; }
.cta-banner .cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
.cta-banner .burst { position: absolute; opacity: 0.5; pointer-events: none; }
.cta-banner .burst.one { top: -40px; left: -40px; width: 220px; height: 220px; }
.cta-banner .burst.two { bottom: -60px; right: -30px; width: 260px; height: 260px; }
.cta-wrap { padding-block: var(--sp-8); }

/* ---------- Service areas ---------- */
.area-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .area-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .area-grid { grid-template-columns: repeat(4, 1fr); } }
.area-chip {
  padding: var(--sp-4);
  text-align: center;
  font-weight: 700;
  color: var(--sky-800);
  font-size: 0.95rem;
}
.area-chip svg { width: 20px; height: 20px; margin-inline: auto var(--sp-1); color: var(--sky-600); }

.area-detail {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
  margin-top: var(--sp-7);
}
@media (min-width: 720px) { .area-detail { grid-template-columns: repeat(2, 1fr); } }
.area-detail-card { padding: var(--sp-6); }
.area-detail-card h3 { margin-bottom: 0.4rem; color: var(--sky-800); }
.area-detail-card p { color: var(--ink-muted); font-size: 0.96rem; }

/* ---------- About page ---------- */
.story-grid {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) { .story-grid { grid-template-columns: 1.1fr 0.9fr; } }
.value-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .value-grid { grid-template-columns: repeat(2, 1fr); } }

.team-card { padding: var(--sp-6); text-align: center; }
.team-avatar { width: 88px; height: 88px; margin-inline: auto var(--sp-4); }
.team-name { font-weight: 800; color: var(--ink); }
.team-role { color: var(--sky-700); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--sp-3); }
.team-bio { color: var(--ink-muted); font-size: 0.93rem; margin-inline: auto; }

.cert-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .cert-grid { grid-template-columns: repeat(3, 1fr); } }
.cert-card { padding: var(--sp-6); text-align: center; }
.cert-card .icon-badge { margin-inline: auto var(--sp-3); }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: 1fr;
}
@media (min-width: 940px) { .contact-grid { grid-template-columns: 1.1fr 0.9fr; } }

.contact-form { padding: var(--sp-7); }
.form-row { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; margin-bottom: var(--sp-5); }
@media (min-width: 560px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.field input,
.field select,
.field textarea {
  border: 1.5px solid var(--sky-300);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--r-sm);
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--sky-600); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.85rem; color: var(--ink-muted); margin-top: var(--sp-3); }

.info-card { padding: var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-6); }
.info-row { display: flex; gap: var(--sp-3); align-items: flex-start; }
.info-row .icon-badge { width: 44px; height: 44px; flex-shrink: 0; }
.info-row .icon-badge svg { width: 22px; height: 22px; }
.info-row h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.info-row p, .info-row a { color: var(--ink-muted); font-size: 0.95rem; text-decoration: none; }
.info-row a:hover { color: var(--sky-800); text-decoration: underline; }

table.hours { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.hours caption { text-align: left; font-weight: 800; color: var(--ink); margin-bottom: var(--sp-2); }
table.hours th, table.hours td { text-align: left; padding: 0.5rem 0; border-bottom: 1px solid rgba(79, 179, 232, 0.2); }
table.hours th { color: var(--ink-muted); font-weight: 600; width: 55%; }
table.hours td { font-weight: 700; color: var(--ink); }

.map-card { padding: var(--sp-6); text-align: center; }
.map-card svg { margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sky-900);
  color: var(--ink-on-dark);
  padding-block: var(--sp-9) var(--sp-6);
  margin-top: var(--sp-9);
}
.footer-grid {
  display: grid;
  gap: var(--sp-7);
  grid-template-columns: 1fr;
}
@media (min-width: 780px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-sub { color: var(--sky-300); }
.footer-brand p { color: rgba(238, 248, 255, 0.75); margin-top: var(--sp-3); font-size: 0.92rem; }
.footer-social { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.footer-social a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  text-decoration: none;
}
.footer-social a:hover { background: rgba(255, 255, 255, 0.2); }
.footer-social svg { width: 18px; height: 18px; color: #fff; }
.footer-col h3 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-4); }
.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { color: rgba(238, 248, 255, 0.8); text-decoration: none; font-size: 0.94rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(238, 248, 255, 0.65);
}

/* ---------- Floating call button (mobile) ---------- */
.fab-call {
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 90;
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  color: #fff;
  padding: 0.85rem 1.2rem;
  border-radius: var(--r-full);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(19, 74, 107, 0.35);
}
.fab-call svg { width: 20px; height: 20px; }
@media (max-width: 720px) { .fab-call { display: inline-flex; } }

/* ---------- Misc ---------- */
.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;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* =========================================================
   Booking / Portal / Estimate — Addendum Components
   ========================================================= */

/* ---------- Shared layout helpers ---------- */
.demo-grid { display: grid; gap: var(--sp-8); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .demo-grid.with-aside { grid-template-columns: 1.4fr 1fr; } }
.sticky-aside { position: sticky; top: calc(72px + var(--sp-5)); }
fieldset { border: none; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 0.9rem; color: var(--ink); margin-bottom: 0.6rem; padding: 0; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
[hidden] { display: none !important; }

.field-error { color: #b3261e; font-size: 0.8rem; margin-top: 0.3rem; display: none; }
.field.has-error input, .field.has-error select { border-color: #b3261e; }
.field.has-error .field-error { display: block; }

/* ---------- Callout (contact -> booking) ---------- */
.callout {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-7);
}
.callout .icon-badge { width: 44px; height: 44px; flex-shrink: 0; }
.callout .icon-badge svg { width: 22px; height: 22px; }
.callout p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }
.callout strong { color: var(--ink); }
.callout .btn { flex-shrink: 0; margin-left: auto; }
@media (max-width: 640px) {
  .callout { flex-direction: column; align-items: flex-start; }
  .callout .btn { margin-left: 0; }
}

/* ---------- Calendar ---------- */
.cal-card { padding: var(--sp-7); }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-5); flex-wrap: wrap; gap: var(--sp-2); }
.cal-head h2 { margin: 0; font-size: 1.3rem; }
.cal-head p { margin: 0; color: var(--ink-muted); font-size: 0.85rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { text-align: center; font-size: 0.72rem; font-weight: 800; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; padding-block: 4px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.92rem;
  font-family: inherit;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.cal-day.is-empty { background: transparent; border: none; cursor: default; }
.cal-day.is-available:hover { border-color: var(--sky-500); background: #fff; transform: translateY(-1px); }
.cal-day.is-selected { background: linear-gradient(135deg, var(--sky-600), var(--sky-800)); color: #fff; box-shadow: 0 8px 18px rgba(28, 111, 156, 0.3); }
.cal-day:disabled, .cal-day.is-disabled {
  background: transparent;
  color: var(--ink-muted);
  opacity: 0.42;
  cursor: not-allowed;
  text-decoration: line-through;
}
.cal-legend { display: flex; gap: var(--sp-5); margin-top: var(--sp-5); font-size: 0.82rem; color: var(--ink-muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cal-dot.avail { background: var(--sky-500); }
.cal-dot.sel { background: var(--sky-800); }
.cal-dot.un { background: var(--ink-muted); opacity: 0.5; }

/* ---------- Time slots ---------- */
.slot-section { margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 1px solid rgba(79, 179, 232, 0.2); }
.slot-section h3 { margin-bottom: var(--sp-4); font-size: 1.05rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
.slot-btn {
  padding: 0.8rem 1rem;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--sky-300);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  color: var(--sky-800);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  font-family: inherit;
}
.slot-btn:hover { border-color: var(--sky-600); background: #fff; }
.slot-btn.is-selected { background: linear-gradient(135deg, var(--sky-600), var(--sky-800)); color: #fff; border-color: transparent; }

/* ---------- Segmented radio control ---------- */
.segmented { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.segmented label {
  padding: 0.6rem 1.15rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--sky-300);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--sky-800);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.segmented label:hover { border-color: var(--sky-600); }
.segmented input:checked + label { background: linear-gradient(135deg, var(--sky-600), var(--sky-800)); color: #fff; border-color: transparent; }
.segmented input:focus-visible + label { outline: 3px solid var(--sky-700); outline-offset: 2px; }

/* ---------- Stepper ---------- */
.stepper { display: inline-flex; align-items: center; gap: var(--sp-3); }
.stepper-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--sky-300);
  background: #fff;
  color: var(--sky-800);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
}
.stepper-btn:hover { border-color: var(--sky-600); background: var(--sky-100); }
.stepper-input {
  width: 64px;
  text-align: center;
  border: 1.5px solid var(--sky-300);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.3rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  font-family: inherit;
  background: rgba(255, 255, 255, 0.85);
}

/* ---------- Toggle switch ---------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-3); border-bottom: 1px solid rgba(79, 179, 232, 0.15); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row-text strong { display: block; color: var(--ink); font-size: 0.95rem; font-weight: 700; }
.toggle-row-text small { color: var(--ink-muted); font-size: 0.82rem; }
.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; }
.toggle-track { position: absolute; inset: 0; background: rgba(79, 179, 232, 0.28); border-radius: var(--r-full); transition: background 0.18s var(--ease); pointer-events: none; }
.toggle-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(19, 74, 107, 0.3);
  transition: transform 0.18s var(--ease);
}
.toggle-switch input:checked + .toggle-track { background: linear-gradient(135deg, var(--sky-600), var(--sky-800)); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-track { outline: 3px solid var(--sky-700); outline-offset: 3px; }

/* ---------- Price / estimate ---------- */
.price-panel { padding: var(--sp-7); }
.price-range { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--sky-800); }
.price-sub { color: var(--ink-muted); font-size: 0.9rem; margin-top: 0.2rem; }
.breakdown-list { margin-top: var(--sp-6); display: flex; flex-direction: column; gap: 0.2rem; }
.breakdown-row { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 0.92rem; color: var(--ink-body); padding-block: 0.5rem; border-bottom: 1px dashed rgba(79, 179, 232, 0.25); }
.breakdown-row.total { font-weight: 800; color: var(--ink); border-bottom: none; font-size: 1.05rem; padding-top: 0.9rem; }
.disclaimer-note { display: flex; gap: 0.6rem; align-items: flex-start; background: var(--sky-100); border-radius: var(--r-sm); padding: var(--sp-4); font-size: 0.85rem; color: var(--ink-muted); margin-top: var(--sp-6); }
.disclaimer-note svg { width: 18px; height: 18px; color: var(--sky-700); flex-shrink: 0; margin-top: 0.1rem; }

/* ---------- Portal login ---------- */
.login-wrap { min-height: 56vh; display: flex; align-items: center; justify-content: center; padding-block: var(--sp-8); }
.login-card { width: 100%; max-width: 440px; padding: var(--sp-8) var(--sp-7); text-align: center; }
.login-card .icon-badge { margin-inline: auto var(--sp-4); width: 60px; height: 60px; }
.login-card .icon-badge svg { width: 30px; height: 30px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: var(--sp-2); }
.login-card > p { color: var(--ink-muted); font-size: 0.92rem; margin-inline: auto; margin-bottom: var(--sp-6); max-width: 34ch; }
.login-card form { display: flex; flex-direction: column; gap: var(--sp-4); text-align: left; }
.login-divider { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-muted); font-size: 0.8rem; margin-block: var(--sp-5); }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: rgba(79, 179, 232, 0.25); }

/* ---------- Dashboard ---------- */
.dash-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-7); }
.dash-greeting h1 { font-size: 1.6rem; margin-bottom: 0.2rem; }
.dash-greeting p { color: var(--ink-muted); margin: 0; font-size: 0.92rem; }
.dash-section { margin-bottom: var(--sp-8); }
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-4); flex-wrap: wrap; gap: var(--sp-2); }
.dash-section-head h2 { font-size: 1.2rem; margin: 0; }
.appt-card { padding: var(--sp-5) var(--sp-6); display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-4); flex-wrap: wrap; }
.appt-date {
  background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  color: #fff;
  border-radius: var(--r-md);
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
}
.appt-date .mon { font-size: 0.68rem; text-transform: uppercase; font-weight: 700; }
.appt-date .day { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.appt-info { flex: 1; min-width: 180px; }
.appt-info h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.appt-info p { color: var(--ink-muted); font-size: 0.88rem; margin: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data-table th, table.data-table td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid rgba(79, 179, 232, 0.18); white-space: nowrap; }
table.data-table th { color: var(--ink-muted); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.data-table td { color: var(--ink-body); }
.data-table-wrap { overflow-x: auto; padding: var(--sp-6); }

.status-pill { display: inline-flex; align-items: center; padding: 0.28rem 0.75rem; border-radius: var(--r-full); font-size: 0.76rem; font-weight: 800; white-space: nowrap; }
.status-pill.paid { background: rgba(79, 179, 232, 0.16); color: var(--sky-800); }
.status-pill.due { background: rgba(245, 185, 66, 0.24); color: #8a5c00; }
.status-pill.complete { background: rgba(79, 179, 232, 0.16); color: var(--sky-800); }
.status-pill.scheduled { background: rgba(124, 201, 240, 0.24); color: var(--sky-800); }

.invoice-card { padding: var(--sp-6); margin-bottom: var(--sp-5); }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.invoice-head h3 { margin-bottom: 0.15rem; font-size: 1.05rem; }
.invoice-head p { margin: 0; color: var(--ink-muted); font-size: 0.85rem; }
.invoice-amount { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; color: var(--ink); text-align: right; }
table.invoice-items { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-bottom: var(--sp-4); }
table.invoice-items td { padding: 0.4rem 0; border-bottom: 1px dashed rgba(79, 179, 232, 0.2); color: var(--ink-body); }
table.invoice-items td:last-child { text-align: right; font-weight: 700; }
table.invoice-items tr.total td { border-bottom: none; font-weight: 800; color: var(--ink); padding-top: 0.6rem; }
.invoice-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }

.account-grid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .account-grid { grid-template-columns: repeat(2, 1fr); } }
.account-item dt { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); font-weight: 700; margin-bottom: 0.25rem; }
.account-item dd { margin: 0; color: var(--ink); font-weight: 700; font-size: 0.95rem; }

/* ---------- Recurring plan manager ---------- */
.plan-card { padding: var(--sp-7); }
.plan-current { display: flex; flex-wrap: wrap; gap: var(--sp-6); align-items: center; justify-content: space-between; padding: var(--sp-5); background: var(--sky-100); border-radius: var(--r-md); margin-bottom: var(--sp-6); }
.plan-current-freq { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--sky-800); }
.plan-current p { margin: 0; color: var(--ink-muted); font-size: 0.85rem; }
.plan-price { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; color: var(--ink); text-align: right; }
.plan-price small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 0.76rem; color: var(--ink-muted); }
.plan-includes { list-style: none; padding: 0; margin: var(--sp-5) 0; display: flex; flex-direction: column; gap: 0.5rem; }
.plan-includes li { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.92rem; color: var(--ink-body); }
.plan-includes svg { width: 18px; height: 18px; color: var(--sky-700); flex-shrink: 0; margin-top: 0.15rem; }
.plan-switch { margin-top: var(--sp-6); }
.plan-switch h3 { font-size: 1rem; margin-bottom: var(--sp-3); }
.plan-history { margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 1px solid rgba(79, 179, 232, 0.2); }
.plan-history h3 { font-size: 1rem; margin-bottom: var(--sp-3); }
.plan-history ul { display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.87rem; color: var(--ink-muted); }
.plan-history li { display: flex; justify-content: space-between; gap: var(--sp-3); border-bottom: 1px dashed rgba(79, 179, 232, 0.2); padding-bottom: 0.55rem; }
.plan-history li:last-child { border-bottom: none; padding-bottom: 0; }

/* ---------- Payment modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 48, 73, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  z-index: 1000;
}
.modal-box { width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; padding: var(--sp-7); position: relative; }
.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(79, 179, 232, 0.14);
  color: var(--sky-800);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover { background: rgba(79, 179, 232, 0.24); }
.modal-box h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.modal-box .modal-sub { color: var(--ink-muted); font-size: 0.88rem; margin-bottom: var(--sp-5); }
.trust-row { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-muted); font-size: 0.8rem; margin-top: var(--sp-4); justify-content: center; }
.trust-row svg { width: 16px; height: 16px; color: var(--sky-700); flex-shrink: 0; }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.pay-state[hidden] { display: none; }
.spinner-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); padding-block: var(--sp-7); }
.spinner { width: 52px; height: 52px; border-radius: 50%; border: 4px solid rgba(79, 179, 232, 0.2); border-top-color: var(--sky-700); animation: cvw-spin 0.9s linear infinite; }
@keyframes cvw-spin { to { transform: rotate(360deg); } }
.spinner-wrap p { color: var(--ink-muted); font-size: 0.92rem; margin: 0; }
.success-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding-block: var(--sp-5); }
.success-check { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--sky-600), var(--sky-800)); display: flex; align-items: center; justify-content: center; }
.success-check svg { width: 32px; height: 32px; color: #fff; }
.success-check svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: cvw-draw 0.5s var(--ease) 0.15s forwards; }
@keyframes cvw-draw { to { stroke-dashoffset: 0; } }
.success-wrap h3 { margin: 0; }
.success-wrap p { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }

/* ---------- Booking / estimate confirmation ---------- */
.confirm-wrap { padding: var(--sp-8) var(--sp-7); text-align: center; }
.confirm-wrap .success-check { margin-inline: auto; }
.confirm-ref {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--sky-800);
  background: var(--sky-100);
  padding: 0.6rem 1.2rem;
  border-radius: var(--r-full);
  margin-block: var(--sp-4);
  letter-spacing: 0.02em;
}
.confirm-summary { max-width: 420px; margin-inline: auto; text-align: left; background: var(--bg-alt); border-radius: var(--r-md); padding: var(--sp-5); margin-top: var(--sp-5); }
.confirm-summary dt { font-size: 0.76rem; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; margin-top: var(--sp-3); }
.confirm-summary dt:first-child { margin-top: 0; }
.confirm-summary dd { margin: 0; font-weight: 700; color: var(--ink); }
.confirm-actions { display: flex; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-7); }

/* ---------- Demo note ---------- */
.demo-note { display: flex; align-items: center; gap: 0.5rem; justify-content: center; color: var(--ink-muted); font-size: 0.8rem; margin-top: var(--sp-6); }
.demo-note svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Inline form alert (API errors) ---------- */
.form-alert { color: #b3261e; font-size: 0.85rem; margin-top: var(--sp-3); font-weight: 600; }
