/* One design system for every page: marketing, builder, calculator, tenant site.
   Tokens first; tenant pages override only --brand* (see theme.js). System fonts: fast, private, no CDN. */
:root {
  --ink: #0f2133;
  --ink-soft: #3b4c60;
  --muted: #5a6b7f;
  --line: #d8e1ea;
  --bg: #f5f8fb;
  --surface: #ffffff;
  --brand: #0f6aa8;
  --brand-dark: #0c5586;
  --brand-tint: #e7f2fa;
  --brand-ink: #ffffff;
  --good: #137a43;
  --good-tint: #e6f5ec;
  --warn: #8a5a00;
  --warn-tint: #fff4dc;
  --bad: #b3261e;
  --bad-tint: #fdecea;
  --focus: #1a73e8;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 33, 51, .06), 0 8px 24px -12px rgba(15, 33, 51, .18);
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 var(--s3); text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 var(--s4); text-wrap: pretty; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
ul, ol { padding-left: 1.25rem; }
.lead { font-size: 1.125rem; color: var(--ink-soft); max-width: 60ch; }
.hint { font-size: .875rem; color: var(--muted); margin: var(--s2) 0 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: var(--s4); top: -4rem; background: var(--ink); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: var(--s2); }

/* Layout */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.container.narrow { max-width: 720px; }
.section { padding: var(--s7) 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.stack > * + * { margin-top: var(--s4); }
.grid-2 { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .section { padding: var(--s8) 0; }
}

/* Site chrome */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px; flex-wrap: wrap; padding-top: var(--s2); padding-bottom: var(--s2); }
.brand-mark { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; font-size: 1.15rem; }
.brand-mark::before { content: ""; width: 1.6rem; height: 1.6rem; border-radius: 8px; background: linear-gradient(135deg, var(--brand), #3aa6e0); display: inline-block; }
.nav { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.nav a:not(.btn):hover { color: var(--brand); }
.site-foot { padding-top: var(--s6); padding-bottom: var(--s6); color: var(--muted); font-size: .9rem; }
.site-foot p { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: .65rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); color: var(--brand-ink); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn-lg { min-height: 52px; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: var(--s2); font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* Cards, badges, notices */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.badge { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: var(--good-tint); color: var(--good); font-weight: 700; font-size: .85rem; }
.badge.brand { background: var(--brand-tint); color: var(--brand-dark); }
.notice { border-radius: var(--r-md); padding: var(--s3) var(--s4); background: var(--brand-tint); color: var(--ink); border: 1px solid transparent; }
.notice.warn { background: var(--warn-tint); color: var(--warn); }
.notice.error { background: var(--bad-tint); color: var(--bad); }
.notice.good { background: var(--good-tint); color: var(--good); }

/* Forms */
.field { display: grid; gap: var(--s1); margin-bottom: var(--s4); min-width: 0; }
.field label, .field .label { font-weight: 650; font-size: .95rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .8rem; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid #b9c7d6; border-radius: var(--r-md);
}
textarea { min-height: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #8aa0b6; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[type=color] { width: 64px; min-height: 46px; padding: 3px; border: 1.5px solid #b9c7d6; border-radius: var(--r-md); background: #fff; }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); flex: none; }
.check { display: flex; gap: var(--s3); align-items: center; min-height: 44px; font-weight: 600; }
.check input { margin: 0; }
.form-grid { display: grid; gap: 0 var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.hp-wrap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.form-status { margin: 0; font-weight: 600; color: var(--ink-soft); }
.form-status.is-error { color: var(--bad); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; }

/* Hero (marketing) */
.hero-marketing { background: linear-gradient(180deg, var(--brand-tint), var(--bg)); padding: var(--s7) 0 var(--s6); }
.hero-marketing h1 { max-width: 16ch; }
.hero-marketing h1 em { font-style: normal; color: var(--brand); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.steps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); counter-reset: s; }
.steps-list li { counter-increment: s; position: relative; padding: var(--s5) var(--s5) var(--s5) 4.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.steps-list li::before { content: counter(s); position: absolute; left: var(--s5); top: var(--s5); width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.steps-list h3 { margin-bottom: var(--s1); }
.steps-list p { margin: 0; color: var(--ink-soft); }
@media (min-width: 900px) { .steps-list { grid-template-columns: repeat(3, 1fr); } }

/* Pricing cards */
.price-card { display: flex; flex-direction: column; gap: var(--s3); position: relative; }
.price-card.featured { border: 2px solid var(--brand); }
.price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.price small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.tick-list li { padding-left: 1.6rem; position: relative; }
.tick-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: .9rem; height: .5rem; border-left: 3px solid var(--good); border-bottom: 3px solid var(--good); transform: rotate(-45deg); }
.price-card .btn { margin-top: auto; }

/* FAQ */
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 var(--s4); margin-bottom: var(--s3); }
details.faq summary { cursor: pointer; font-weight: 700; padding: var(--s4) 0; min-height: 44px; list-style-position: outside; }
details.faq[open] summary { border-bottom: 1px solid var(--line); margin-bottom: var(--s3); }
details.faq p { color: var(--ink-soft); }

/* Builder */
.builder-head { padding: var(--s5) 0 var(--s3); }
.stepper-nav { list-style: none; display: flex; gap: var(--s2); padding: 0; margin: 0 0 var(--s5); flex-wrap: wrap; }
.stepper-nav li { flex: 1 1 8rem; min-width: 0; }
.stepper-nav button { width: 100%; min-height: 44px; padding: .5rem .75rem; font: inherit; font-weight: 650; font-size: .9rem; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--muted); cursor: pointer; display: flex; gap: var(--s2); align-items: center; }
.stepper-nav button .num { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink-soft); font-size: .8rem; flex: none; }
.stepper-nav button[aria-current=step] { border-color: var(--brand); color: var(--ink); background: var(--brand-tint); }
.stepper-nav button[aria-current=step] .num { background: var(--brand); color: #fff; }
.stepper-nav button.done .num { background: var(--good); color: #fff; }
.step-panel { margin-bottom: var(--s5); }
.step-panel[hidden] { display: none; }
.step-actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; margin-top: var(--s5); }
.sub-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); margin-bottom: var(--s4); background: #fbfdff; }
.sub-card h3 { font-size: 1.05rem; }
.num-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .num-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .num-grid.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.num-grid .field { margin-bottom: 0; }
.num-grid label { font-size: .8rem; }
.hours-cell { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.hours-cell .field label { font-size: .7rem; }
.hours-block { margin-bottom: var(--s4); }
.hours-block h4 { margin: 0 0 var(--s2); font-size: .95rem; }
.hours-row { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .hours-row { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.extra-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); margin-bottom: var(--s3); background: #fff; }
.extra-row .row-actions { display: flex; justify-content: flex-end; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.edit-link-box { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: stretch; }
.edit-link-box code, .code-box { flex: 1 1 14rem; min-width: 0; padding: .6rem .8rem; background: #0f2133; color: #e9f1f9; border-radius: var(--r-md); font-size: .85rem; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; display: block; }
.preview-frame { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.plan-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
@media (min-width: 760px) { .plan-grid { grid-template-columns: 1fr 1fr; } }

/* Calculator (customer-facing) */
.calc-page, .site-page { background: var(--bg); }
.calc-page.is-embed { background: transparent; }
.is-embed .container { padding-left: 0; padding-right: 0; max-width: none; }
.firm-head { display: flex; gap: var(--s4); align-items: center; padding-top: var(--s5); padding-bottom: var(--s3); }
.firm-head h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin: 0; }
.firm-head p { margin: 0; color: var(--muted); }
.firm-logo { width: 64px; height: 64px; object-fit: contain; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); flex: none; }
.calc { padding: var(--s4) 0 var(--s6); }
.is-embed .calc { padding: var(--s2) 0; }
.ribbon { background: var(--warn-tint); color: var(--warn); border: 1px solid #f0d9a2; border-radius: var(--r-md); padding: var(--s3) var(--s4); font-weight: 650; margin-bottom: var(--s4); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--brand-tint); padding: 6px; border-radius: 999px; margin-bottom: var(--s5); max-width: 520px; }
.tab { min-height: 44px; border: 0; border-radius: 999px; padding: .5rem .75rem; font: inherit; font-weight: 650; background: transparent; color: var(--ink); cursor: pointer; }
.tab[aria-selected=true] { background: var(--brand); color: var(--brand-ink); }
.tab:focus-visible { outline-offset: 0; }
.calc-grid { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: var(--s5); }
@media (min-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 1fr) 340px; } .calc-total { position: sticky; top: var(--s5); } }
.calc-options { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); min-width: 0; }
.is-embed .calc-options, .is-embed .calc-form, .is-embed .card { box-shadow: none; }
.panel { display: grid; gap: var(--s5); }
.group { display: block; }
.group legend { font-weight: 750; font-size: 1.1rem; letter-spacing: -.01em; margin-bottom: var(--s3); }
.group-row { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .group-row { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.choice-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.choice { text-align: left; display: grid; gap: var(--s1); padding: var(--s4); border-radius: var(--r-lg); border: 2px solid var(--line); background: #fff; color: var(--ink); font: inherit; cursor: pointer; min-height: 44px; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--brand); }
.choice[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.choice-tag { justify-self: start; font-size: .75rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); }
.choice[aria-pressed=true] .choice-tag { background: rgba(255,255,255,.2); color: var(--brand-ink); }
.choice-title { font-weight: 750; font-size: 1.1rem; }
.choice-body { font-size: .9rem; opacity: .85; }
.pill-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pill { min-height: 44px; min-width: 44px; padding: .5rem 1rem; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s; }
.pill:hover { border-color: var(--brand); }
.pill[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pill-check[aria-pressed=true]::before { content: "\2713"; margin-right: .4em; }
.stepper { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink); }
.step-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.step-btn:disabled { opacity: .4; cursor: not-allowed; }
.step-val { display: grid; min-width: 7rem; text-align: center; }
.step-val strong { font-size: 1.5rem; letter-spacing: -.02em; }
.step-val span { font-size: .85rem; color: var(--muted); }
.calc-total { background: #0f2133; color: #fff; border-radius: var(--r-lg); padding: var(--s5); }
.total-label { margin: 0 0 var(--s1); color: #c4d3e2; font-size: .95rem; }
.total-amount { margin: 0; font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.total-vat { font-size: 1rem; font-weight: 600; margin-left: .4rem; color: #c4d3e2; letter-spacing: 0; }
.total-note { margin: var(--s2) 0 0; color: #c4d3e2; font-size: .9rem; }
.total-cta { margin-top: var(--s4); background: #fff; color: #0f2133; }
.total-cta:hover { background: var(--brand-tint); color: #0f2133; }
.calc-form h2 { font-size: 1.4rem; }
.offer-line { color: var(--ink-soft); }
.sent h2 { font-size: 1.4rem; }
@media (max-width: 899px) {
  .calc-total { position: sticky; bottom: 0; z-index: 5; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s3) var(--s4); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 var(--s3); margin-inline: calc(var(--s4) * -1); }
  .is-embed .calc-total { position: static; border-radius: var(--r-lg); margin-inline: 0; }
  .calc-total .total-label { grid-column: 1; font-size: .8rem; }
  .calc-total .total-amount { grid-column: 1; font-size: 1.9rem; }
  .calc-total .total-note { display: none; }
  .calc-total .total-cta { grid-column: 2; grid-row: 1 / span 2; margin: 0; width: auto; padding-inline: var(--s4); }
  .calc { padding-bottom: 0; }
}

/* Tenant one-page site */
.hero { background: var(--brand); color: var(--brand-ink); padding: var(--s7) 0; }
.hero-inner { display: grid; gap: var(--s3); justify-items: start; }
.hero .firm-logo { width: 80px; height: 80px; }
.hero h1 { margin: 0; }
.hero-tag { font-size: 1.2rem; max-width: 40ch; margin: 0 0 var(--s3); opacity: .95; }
.about { font-size: 1.1rem; color: var(--ink-soft); white-space: pre-line; }
.service-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.service .from { font-weight: 750; color: var(--brand-dark); margin: 0; }
.service p { color: var(--ink-soft); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0; margin: 0; }
.chips li { padding: .35rem .9rem; border-radius: 999px; background: var(--brand-tint); font-weight: 650; color: var(--ink); }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); font-size: 1.1rem; }
.contact-list a { font-weight: 650; overflow-wrap: anywhere; }
.message-page { padding-top: var(--s7); padding-bottom: var(--s7); }

/* Welcome */
.copy-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.platform-steps { padding-left: 1.2rem; }
.platform-steps li { margin-bottom: var(--s2); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.spots-left { font-weight: 800; }
[hidden] { display: none !important; }
