/* =========================================================================
   AquaClear Pool Care — shared stylesheet
   Design system: resort turquoise + coral, floating rounded cards, wave
   dividers. Spacing scale is base-8. System font stack only.
   ========================================================================= */

:root {
  /* --- Color: text/button-safe (AA verified against white or each other) */
  --teal-900: #0b6e69;   /* headings, body links, primary button bg */
  --teal-700: #0e8e88;   /* gradient partner, hover state */
  --teal-400: #1fc7be;   /* bright accent — decorative only, never as text-on-white */
  --teal-050: #eafbfa;   /* tinted section background */
  --coral-700: #c0392b;  /* CTA button bg (AA with white text) */
  --coral-500: #e05a3c;  /* hover state for CTA */
  --coral-400: #f4694e;  /* bright accent — decorative only */
  --coral-050: #fff0ea;  /* tinted section background */
  --sand-050: #fff8ef;   /* warm alt section background */
  --ink: #16302e;        /* body text */
  --muted: #4b6664;      /* secondary text, AA-verified */
  --white: #ffffff;
  --line: #e1efed;       /* hairline borders */

  /* --- Elevation */
  --shadow-sm: 0 2px 8px rgba(11, 60, 56, 0.08);
  --shadow-md: 0 12px 28px rgba(11, 60, 56, 0.14);
  --shadow-lg: 0 24px 48px rgba(11, 60, 56, 0.18);

  /* --- Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  /* --- Spacing scale (base 8px) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-10: 80px;
  --sp-12: 96px;

  /* --- Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  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;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 1rem;
  overflow-x: hidden;
}

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

a {
  color: var(--teal-900);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--coral-700);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  color: var(--teal-900);
  line-height: 1.15;
  margin: 0 0 var(--sp-2);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
}

h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
}

p {
  margin: 0 0 var(--sp-3);
  max-width: 68ch;
}

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

/* ---------- Layout ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--sp-3);
}

.section {
  padding-block: var(--sp-10);
}

.section-alt {
  background: var(--sand-050);
}

.section-tint {
  background: var(--teal-050);
}

.section-header {
  max-width: 62ch;
  margin-bottom: var(--sp-6);
}

.section-header.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--coral-700);
  margin-bottom: var(--sp-1);
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--coral-700);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--coral-500);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--teal-900);
  border-color: var(--teal-900);
}

.btn-secondary:hover {
  background: var(--teal-050);
  color: var(--teal-900);
}

.btn-on-dark {
  background: var(--white);
  color: var(--teal-900);
}

.btn-on-dark:hover {
  background: var(--sand-050);
  color: var(--teal-900);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--sp-2);
  gap: var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--teal-900);
  font-weight: 800;
  font-size: 1.15rem;
}

.brand:hover {
  color: var(--teal-900);
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
}

.brand-name {
  white-space: nowrap;
}

.brand-name small {
  display: block;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--teal-050);
  background: var(--white);
  cursor: pointer;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
}

.main-nav {
  display: none;
  width: 100%;
}

.main-nav.is-open {
  display: block;
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding-block: var(--sp-2);
  border-top: 1px solid var(--line);
}

.main-nav a {
  display: block;
  padding: 10px var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--teal-900);
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover {
  background: var(--teal-050);
}

.main-nav a[aria-current="page"] {
  background: var(--teal-900);
  color: var(--white);
}

.header-cta {
  display: none;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .main-nav {
    display: block;
    width: auto;
  }

  .main-nav ul {
    flex-direction: row;
    align-items: center;
    border-top: none;
    padding-block: 0;
    gap: var(--sp-1);
  }

  .main-nav a[aria-current="page"] {
    background: var(--teal-050);
    color: var(--teal-900);
    box-shadow: inset 0 -3px 0 var(--coral-700);
    border-radius: var(--radius-sm);
  }

  .header-cta {
    display: inline-flex;
  }
}

/* ---------- Hero ---------------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, #0a5f5b 0%, #0b6e69 45%, #0c7a75 100%);
  color: var(--white);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--sp-6);
  padding-block: var(--sp-10) var(--sp-8);
  align-items: center;
}

.hero-copy .eyebrow {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.hero h1 {
  color: var(--white);
  margin-bottom: var(--sp-2);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.94);
  font-size: 1.125rem;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.hero-art {
  width: 100%;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.15));
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.1fr 1fr;
    padding-block: var(--sp-12) var(--sp-10);
  }
}

/* ---------- Wave dividers -------------------------------------------------- */
.wave-divider {
  display: block;
  width: 100%;
  height: auto;
  line-height: 0;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

@media (min-width: 900px) {
  .wave-divider svg {
    height: 90px;
  }
}

/* ---------- Stats bar ------------------------------------------------------ */
.stats-bar {
  background: var(--teal-900);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4) var(--sp-2);
  padding-block: var(--sp-6);
  text-align: center;
}

.stat-number {
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  font-weight: 800;
  color: var(--white);
  display: block;
}

.stat-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (min-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Cards ----------------------------------------------------------- */
.card-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.card-icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--sp-2);
}

.card h3 {
  margin-bottom: var(--sp-1);
}

.card p {
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

.card-link {
  margin-top: auto;
  font-weight: 700;
  text-decoration: none;
}

.floating-row {
  margin-top: calc(var(--sp-10) * -1);
  position: relative;
  z-index: 3;
}

/* ---------- Why choose us -------------------------------------------------- */
.reasons-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
  .reasons-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.reason {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.reason-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--teal-050);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reason-icon svg {
  width: 24px;
  height: 24px;
}

.reason h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.reason p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ---------- Testimonials ---------------------------------------------------- */
.testimonial {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  position: relative;
}

.testimonial-quote {
  color: var(--ink);
  font-size: 1.05rem;
  margin-bottom: var(--sp-3);
}

.testimonial-quote::before {
  content: "\201C";
  color: var(--coral-400);
  font-size: 2.5rem;
  line-height: 0;
  display: inline-block;
  vertical-align: -0.3em;
  margin-right: 4px;
  font-family: Georgia, serif;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
}

.testimonial-name {
  font-weight: 700;
  color: var(--teal-900);
  display: block;
}

.testimonial-place {
  color: var(--muted);
  font-size: 0.875rem;
}

.stars {
  color: var(--coral-700);
  letter-spacing: 2px;
  margin-bottom: var(--sp-1);
  font-size: 0.95rem;
}

/* ---------- CTA banner ------------------------------------------------------ */
.cta-banner {
  background: linear-gradient(120deg, var(--coral-700), var(--coral-500));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner h2 {
  color: var(--white);
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.94);
  margin-inline: auto;
}

.cta-banner .btn-primary {
  background: var(--white);
  color: var(--coral-700);
}

.cta-banner .btn-primary:hover {
  background: var(--sand-050);
  color: var(--coral-700);
}

.cta-inner {
  position: relative;
  z-index: 2;
  max-width: 46ch;
  margin-inline: auto;
}

/* ---------- Service area teaser chips --------------------------------------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-block: var(--sp-3);
}

.chip {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--teal-050);
  color: var(--teal-900);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.chip:hover {
  background: var(--teal-900);
  color: var(--white);
}

/* ---------- Services page ---------------------------------------------------- */
.service-detail {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  align-items: start;
}

@media (min-width: 700px) {
  .service-detail {
    grid-template-columns: 88px 1fr;
    align-items: center;
    gap: var(--sp-4);
  }
}

.service-detail-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  background: var(--teal-050);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-1);
}

.service-detail-icon svg {
  width: 44px;
  height: 44px;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* ---------- About page -------------------------------------------------------- */
.values-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .values-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.team-card {
  text-align: center;
}

.avatar {
  width: 96px;
  height: 96px;
  margin-inline: auto var(--sp-2);
  margin-bottom: var(--sp-2);
}

.team-role {
  color: var(--coral-700);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}

.cert-list {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .cert-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cert-item {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}

.cert-item svg {
  width: 36px;
  height: 36px;
  flex: none;
}

/* ---------- Service areas page -------------------------------------------------- */
.area-grid {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .area-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .area-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.area-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px var(--sp-2);
  font-weight: 700;
  color: var(--teal-900);
}

.area-pill svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.area-detail-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .area-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.area-detail-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* ---------- Contact page ---------------------------------------------------- */
.contact-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.contact-info-card {
  background: var(--teal-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.contact-info-card h2,
.contact-info-card h3 {
  color: var(--white);
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.contact-info-item {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.contact-info-item svg {
  width: 26px;
  height: 26px;
  flex: none;
  margin-top: 2px;
}

.contact-info-item a {
  color: var(--white);
  font-weight: 700;
}

.contact-info-item p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hours-table caption {
  text-align: left;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  color: var(--white);
}

.hours-table th,
.hours-table td {
  text-align: left;
  padding: 10px var(--sp-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
}

.hours-table tr:last-child th,
.hours-table tr:last-child td {
  border-bottom: none;
}

.hours-table th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.hours-table td {
  color: var(--white);
  font-weight: 700;
  text-align: right;
}

.emergency-note {
  margin-top: var(--sp-3);
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.9rem;
}

.emergency-note p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.94);
}

.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
}

.form-row {
  margin-bottom: var(--sp-3);
}

.form-row.two-col {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .form-row.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--teal-900);
  font-size: 0.925rem;
}

.required {
  color: var(--coral-700);
}

input,
select,
textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal-700);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: var(--sp-2);
}

/* ---------- Footer ------------------------------------------------------------- */
.site-footer {
  background: #0a2a28;
  color: rgba(255, 255, 255, 0.85);
}

.footer-inner {
  display: grid;
  gap: var(--sp-4);
  padding-block: var(--sp-8) var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .footer-inner {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  margin-bottom: var(--sp-2);
}

.footer-brand svg {
  width: 36px;
  height: 36px;
}

.site-footer h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: var(--sp-2);
}

.site-footer address {
  font-style: normal;
  line-height: 1.7;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: var(--coral-400);
}

.footer-nav li {
  margin-bottom: 8px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: var(--sp-3);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* ---------- Misc utility ---------------------------------------------------- */
.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: var(--sp-2);
  top: -60px;
  background: var(--coral-700);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--sp-2);
  color: var(--white);
}

.page-hero {
  background: var(--teal-050);
  padding-block: var(--sp-8) var(--sp-6);
  text-align: center;
}

.page-hero .eyebrow {
  justify-content: center;
}

.page-hero p {
  margin-inline: auto;
  color: var(--muted);
  font-size: 1.05rem;
}

/* =========================================================================
   Booking / Estimate / Portal add-ons (booking.html, estimate.html,
   portal.html) — appended rules only, reuses existing tokens above.
   ========================================================================= */

/* ---------- Shared: demo note, step indicator, flow card -------------------- */
.demo-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sand-050);
  border: 1px dashed var(--coral-400);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-top: var(--sp-3);
}

.demo-note svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.flow-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
}

.step-indicator {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
  list-style: none;
  padding: 0;
}

.step-indicator li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--teal-050);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
}

.step-indicator li .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  color: var(--teal-900);
  font-size: 0.75rem;
  flex: none;
}

.step-indicator li.is-active {
  background: var(--teal-900);
  color: var(--white);
}

.step-indicator li.is-active .step-num {
  background: var(--coral-700);
  color: var(--white);
}

.step-indicator li.is-done {
  background: var(--teal-700);
  color: var(--white);
}

.step-panel {
  margin-bottom: var(--sp-5);
}

.step-panel[hidden] {
  display: none;
}

.step-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--sp-2);
}

.step-panel-title .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal-900);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
  flex: none;
}

.step-panel h2,
.step-panel h3 {
  margin-bottom: 0;
}

.step-summary {
  background: var(--teal-050);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
  font-size: 0.9rem;
  color: var(--teal-900);
  font-weight: 600;
}

/* ---------- Calendar --------------------------------------------------------- */
.calendar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.calendar-head h3 {
  margin-bottom: 0;
}

.calendar-legend {
  display: flex;
  gap: var(--sp-3);
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.available {
  background: var(--teal-700);
}

.legend-dot.unavailable {
  background: var(--line);
  border: 1px solid var(--muted);
}

.legend-dot.selected {
  background: var(--coral-700);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-block: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--white);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--teal-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.calendar-day.is-empty {
  border: none;
  background: transparent;
  cursor: default;
}

.calendar-day.is-available:hover {
  border-color: var(--teal-700);
  background: var(--teal-050);
}

.calendar-day.is-unavailable {
  background: var(--sand-050);
  color: var(--muted);
  border-color: var(--line);
  text-decoration: line-through;
  cursor: not-allowed;
  opacity: 0.65;
}

.calendar-day.is-selected {
  background: var(--coral-700);
  border-color: var(--coral-700);
  color: var(--white);
}

@media (min-width: 640px) {
  .calendar-day {
    font-size: 1.05rem;
  }
}

/* ---------- Time slots -------------------------------------------------------- */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-2);
}

.slot-btn {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--teal-900);
  cursor: pointer;
  text-align: left;
}

.slot-btn:hover {
  border-color: var(--teal-700);
  background: var(--teal-050);
}

.slot-btn.is-selected {
  border-color: var(--coral-700);
  background: var(--coral-700);
  color: var(--white);
}

.slot-btn small {
  display: block;
  font-weight: 600;
  opacity: 0.8;
  font-size: 0.75rem;
  margin-top: 2px;
}

/* ---------- Weekday / recurring day picker ------------------------------------ */
.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.weekday-chip {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--teal-900);
  background: var(--white);
  color: var(--teal-900);
  cursor: pointer;
}

.weekday-chip:hover {
  background: var(--teal-050);
}

.weekday-chip[aria-pressed="true"] {
  background: var(--teal-900);
  color: var(--white);
}

/* ---------- Confirmation screen ------------------------------------------------ */
.confirmation-card {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
}

.confirmation-icon {
  width: 84px;
  height: 84px;
  margin-inline: auto var(--sp-3);
  margin-bottom: var(--sp-3);
}

.confirmation-icon circle {
  transform-origin: center;
  animation: pop-in 0.4s ease;
}

.confirmation-icon path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw-check 0.4s ease 0.3s forwards;
}

@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

.confirmation-ref {
  display: inline-block;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--teal-900);
  background: var(--teal-050);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  margin-block: var(--sp-2) var(--sp-4);
}

.confirmation-details {
  text-align: left;
  max-width: 46ch;
  margin-inline: auto;
  background: var(--sand-050);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.confirmation-details dt {
  font-weight: 700;
  color: var(--teal-900);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--sp-2);
}

.confirmation-details dt:first-child {
  margin-top: 0;
}

.confirmation-details dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 600;
}

.next-steps {
  text-align: left;
  max-width: 52ch;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.next-steps li {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.next-steps .next-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-900);
  color: var(--white);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Estimate builder --------------------------------------------------- */
.estimate-layout {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 960px) {
  .estimate-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.range-field {
  margin-bottom: var(--sp-4);
}

.range-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.range-field-head label {
  margin-bottom: 0;
}

.range-value {
  font-weight: 800;
  color: var(--coral-700);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal-700);
  height: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  background: var(--coral-050);
  border: 1px solid var(--coral-400);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.toggle-row-copy h3 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.toggle-row-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex: none;
}

.switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  position: absolute;
  cursor: pointer;
  z-index: 1;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease;
}

.switch-track::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.switch input:checked ~ .switch-track {
  background: var(--coral-700);
}

.switch input:checked ~ .switch-track::before {
  transform: translateX(22px);
}

.switch input:focus-visible ~ .switch-track {
  outline: 3px solid var(--coral-700);
  outline-offset: 3px;
}

.price-range-card {
  background: linear-gradient(160deg, #0a5f5b 0%, #0b6e69 45%, #0c7a75 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--sp-8));
}

.price-range-card h3 {
  color: var(--white);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: var(--sp-1);
}

.price-range-value {
  font-size: clamp(1.9rem, 1.6rem + 1.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: var(--sp-1);
  line-height: 1.1;
}

.price-range-note {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  margin-bottom: var(--sp-3);
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-2);
}

.breakdown-table th,
.breakdown-table td {
  text-align: left;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.breakdown-table td:last-child,
.breakdown-table th:last-child {
  text-align: right;
}

.breakdown-table tr:last-child th,
.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table .total-row th,
.breakdown-table .total-row td {
  font-weight: 800;
  font-size: 1rem;
  padding-top: var(--sp-2);
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  border-bottom: none;
}

.estimate-disclaimer {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: var(--sp-3);
  margin-bottom: 0;
}

.estimate-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

/* ---------- Deposit invoice ----------------------------------------------------- */
.invoice-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.invoice-head h3 {
  margin-bottom: 2px;
}

.invoice-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.invoice-lines {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-3);
}

.invoice-lines th,
.invoice-lines td {
  text-align: left;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.invoice-lines td:last-child,
.invoice-lines th:last-child {
  text-align: right;
}

.invoice-lines .total-row td,
.invoice-lines .total-row th {
  font-weight: 800;
  border-bottom: none;
  border-top: 2px solid var(--line);
  padding-top: var(--sp-2);
}

.invoice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ---------- Status badges -------------------------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-paid {
  background: var(--teal-050);
  color: var(--teal-900);
}

.status-due {
  background: var(--coral-050);
  color: var(--coral-700);
}

.status-completed {
  background: var(--teal-050);
  color: var(--teal-900);
}

.status-scheduled {
  background: #fff4dd;
  color: #8a5b00;
}

/* ---------- Payment modal --------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 40, 38, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
  z-index: 300;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.modal-head h2 {
  margin-bottom: 0;
}

.modal-close {
  border: none;
  background: var(--teal-050);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: var(--sp-3);
}

.trust-row svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--teal-700);
}

.card-form-row {
  margin-bottom: var(--sp-3);
}

.card-form-row.two-col {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr 1fr;
}

.field-error {
  color: var(--coral-700);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
  display: block;
  min-height: 1.1em;
}

input.has-error,
select.has-error {
  border-color: var(--coral-700);
}

.pay-amount {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--teal-900);
  margin-bottom: var(--sp-3);
}

.modal-state {
  text-align: center;
  padding-block: var(--sp-4);
}

.modal-state[hidden] {
  display: none;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--sp-3);
  border: 5px solid var(--teal-050);
  border-top-color: var(--teal-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

.payment-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-2);
}

/* ---------- Portal login ------------------------------------------------------------ */
.portal-login-wrap {
  max-width: 440px;
  margin-inline: auto;
}

.portal-login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-4);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.portal-login-card h2 {
  font-size: clamp(1.6rem, 1.4rem + 1vw, 2rem);
}

.portal-login-card form {
  text-align: left;
  margin-top: var(--sp-3);
}

.portal-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--muted);
  font-size: 0.8rem;
  margin-block: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-divider::before,
.portal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Portal dashboard ---------------------------------------------------------- */
.portal-dashboard[hidden],
.portal-login-wrap[hidden] {
  display: none;
}

.portal-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.portal-welcome h1 {
  margin-bottom: 4px;
}

.portal-welcome p {
  margin-bottom: 0;
  color: var(--muted);
}

.portal-section {
  margin-bottom: var(--sp-6);
}

.portal-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.portal-section-head h2 {
  margin-bottom: 0;
}

.appointment-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

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

.appointment-card {
  background: var(--teal-050);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.appointment-card svg {
  width: 32px;
  height: 32px;
  flex: none;
}

.appointment-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.appointment-card p {
  margin-bottom: 2px;
  font-size: 0.9rem;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.data-table thead th {
  background: var(--teal-050);
  color: var(--teal-900);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.invoice-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

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

.chem-layout {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .chem-layout {
    grid-template-columns: 1.3fr 1fr;
  }
}

.sparkline-card {
  background: var(--teal-050);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}

.sparkline-card h3 {
  font-size: 0.95rem;
  margin-bottom: var(--sp-2);
}

.sparkline-wrap svg {
  width: 100%;
  height: auto;
}

.sparkline-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: var(--sp-1);
}

.account-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
}

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

.account-item dt {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 2px;
}

.account-item dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.logout-btn {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--teal-900);
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.logout-btn:hover {
  border-color: var(--teal-900);
  background: var(--teal-050);
}
