/* Blue Sparkle Pool Care — shared design system. Pool-water blues & white, phone-first, bright-sun readable. */
:root {
  --blue-50: #f0f9ff; --blue-100: #e0f2fe; --blue-200: #bae6fd; --blue-400: #38bdf8; --blue-500: #0ea5e9; --blue-600: #0284c7; --blue-700: #0369a1; --blue-800: #075985; --blue-900: #0b2a4a;
  --bg: #f6fbff; --surface: #ffffff; --surface-2: #eef6fc; --text: #0b2a4a; --muted: #4b6478; --line: #d5e6f2;
  /* WCAG AA: #0369a1 gives >= 5.3:1 against every light surface and with white text on top */
  --primary: var(--blue-700); --primary-strong: var(--blue-800); --primary-soft: var(--blue-100); --on-primary: #ffffff;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
  --radius: 14px; --shadow: 0 6px 24px rgba(11, 42, 74, 0.08); --gap: 1rem; --maxw: 1120px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #08131c; --surface: #0f1f2b; --surface-2: #142a3a; --text: #e8f4fb; --muted: #9db4c6; --line: #22394b;
  --primary: #38bdf8; --primary-strong: #7dd3fc; --primary-soft: #0c3a54; --on-primary: #07202f;
  --ok: #4ade80; --ok-soft: #12351f; --warn: #fbbf24; --warn-soft: #3a2a08; --bad: #f87171; --bad-soft: #3d1414;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 17px; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 2.25rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Money is one unbreakable token */
.price, .money { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(11,42,74,.06); }
.topbar .wrap { display: flex; align-items: center; gap: .75rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.1rem; }
.brand img { height: 36px; width: auto; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
nav.main { display: flex; gap: .25rem; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
nav.main a, nav.main button { color: var(--text); text-decoration: none; padding: .55rem .8rem; border-radius: 10px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; border: 0; background: transparent; cursor: pointer; }
nav.main a:hover, nav.main a.active, nav.main button:hover { background: var(--primary-soft); color: var(--primary-strong); }
nav.main a:focus-visible, .btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.theme-toggle { min-width: 44px; min-height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 1.1rem; }
.menu-btn { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 1.3rem; margin-left: auto; }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  nav.main { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem 1rem 1rem; flex-direction: column; align-items: stretch; margin-left: 0; box-shadow: var(--shadow); }
  nav.main.open { display: flex; }
  nav.main a, nav.main button { width: 100%; justify-content: flex-start; font-size: 1.05rem; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.25rem; border-radius: 12px; border: 2px solid transparent; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; transition: transform .08s ease, background .15s ease, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(3,105,161,.28); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-outline { background: var(--surface); color: var(--primary-strong); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-lg { font-size: 1.15rem; min-height: 56px; padding: .9rem 1.6rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; min-height: 50px; padding: .7rem .9rem; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.05rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.choice { border: 2px solid var(--line); border-radius: 12px; padding: .8rem; background: var(--surface); cursor: pointer; text-align: left; min-height: 56px; font-weight: 600; color: var(--text); }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.choice .price { display: block; margin-top: .25rem; font-size: 1.1rem; }
.day-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
@media (min-width: 560px) { .day-grid { grid-template-columns: repeat(6, 1fr); } }
.day { min-height: 56px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; cursor: pointer; color: var(--text); }
.day.selected { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
section.block { padding: 3.5rem 0; }
section.block h2 { margin-bottom: 1.25rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 800; color: var(--primary); margin-bottom: .4rem; }

/* Pricing cards: equal height, price on its own line */
.plan-card { display: flex; flex-direction: column; height: 100%; }
.plan-card .plan-title { font-size: 1.15rem; font-weight: 800; margin-bottom: .25rem; }
.plan-card .price { font-size: 2rem; line-height: 1.1; margin: .5rem 0 0; color: var(--primary-strong); }
.plan-card .per { color: var(--muted); font-size: .9rem; margin-bottom: .75rem; }
.plan-card ul { padding-left: 1.1rem; margin: 0 0 1rem; color: var(--muted); }
.plan-card .btn { margin-top: auto; }
.plan-card.featured { border-color: var(--primary); box-shadow: 0 10px 30px rgba(3,105,161,.18); }

/* Hero */
.hero { position: relative; color: #fff; background: linear-gradient(160deg, rgba(3,105,161,.92), rgba(14,165,233,.75) 60%, rgba(11,42,74,.85)), url('/assets/stock-1.webp') center/cover no-repeat; padding: 5rem 0 4.5rem; overflow: hidden; }
.hero h1 { font-size: clamp(3rem, 6vw, 4.25rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 14ch; text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.hero p.lead { font-size: 1.25rem; max-width: 40rem; opacity: .95; margin: 1rem 0 1.75rem; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--blue-700); }
.hero .btn-outline { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.hero .trust { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 2rem; font-weight: 600; opacity: .95; }
.hero .trust span::before { content: "✓ "; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
tr:hover td { background: var(--surface-2); }

/* Pills & status */
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.blue { background: var(--primary-soft); color: var(--primary-strong); }

/* Stats */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: .3rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat.ok .value { color: var(--ok); } .stat.bad .value { color: var(--bad); } .stat.blue .value { color: var(--primary-strong); }

/* Misc */
.alert { padding: .9rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 1rem; }
.alert.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.alert.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.alert.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--blue-900); color: #fff; padding: .8rem 1.2rem; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100vw - 2rem); font-weight: 600; }
.steps { display: flex; gap: .4rem; margin-bottom: 1.25rem; }
.steps span { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.steps span.done { background: var(--primary); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.photo-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photo-ph { aspect-ratio: 1; border-radius: 10px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: .8rem; text-align: center; padding: .4rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gallery img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery figcaption { padding: .9rem 1rem; }
details.faq { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: .25rem 1rem; }
details.faq summary { cursor: pointer; font-weight: 700; padding: .8rem 0; min-height: 44px; display: flex; align-items: center; }
details.faq p { padding-bottom: .8rem; color: var(--muted); }
.suburb-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.suburb-chips span { padding: .5rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 2.5rem 0 5rem; margin-top: 3rem; color: var(--muted); font-size: .95rem; }
footer.site .cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
footer.site h4 { margin: 0 0 .5rem; color: var(--text); }
.emergency-btn { background: var(--bad); color: #fff; border-radius: 16px; padding: 1.25rem; text-align: center; font-weight: 800; font-size: 1.3rem; display: block; text-decoration: none; min-height: 72px; }
.big-check { font-size: 4rem; line-height: 1; }
.list-item { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1 1 200px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .6rem 0 .6rem 1.1rem; border-left: 3px solid var(--line); font-size: .92rem; }
.timeline li b { color: var(--primary-strong); }
.installbar { display: none; background: var(--primary-soft); color: var(--primary-strong); padding: .6rem 1rem; text-align: center; font-weight: 600; }
.installbar.show { display: block; }

/* Admin console layout */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side { background: var(--blue-900); color: #dbeefb; padding: 1rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
[data-theme="dark"] .admin-side { background: #061019; }
.admin-side .brand { color: #fff; margin-bottom: 1.5rem; }
.admin-side .brand small { color: #9fd3f2; }
.admin-nav { display: flex; flex-direction: column; gap: .25rem; }
.admin-nav a { color: #dbeefb; text-decoration: none; padding: .7rem .9rem; border-radius: 10px; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: .6rem; }
.admin-nav a:hover { background: rgba(255,255,255,.08); }
.admin-nav a.active { background: var(--blue-700); color: #fff; }
.admin-main { padding: 1.25rem; min-width: 0; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin-top h1 { font-size: 1.6rem; margin: 0; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; padding-bottom: .5rem; }
  .admin-nav { flex-direction: row; overflow-x: auto; gap: .35rem; padding-bottom: .5rem; }
  .admin-nav a { white-space: nowrap; }
}
