/* Hauslo design system: shared by the sign-in page, the app and the install card.
   Warm paper surfaces, a forest-green brand bar, a serif display face for the wordmark and titles, and
   one set of controls (buttons, chips, fields, switch, cards, compare slider). Light and dark. */

@font-face { font-family: "Instrument Serif"; src: url(/fonts/instrument-serif.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/fonts/instrument-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f6f4ef; --bg-2: #eeebe3;
  --panel: #ffffff; --panel-2: #faf9f5;
  --ink: #18221d; --ink-2: #36423b; --muted: #5b6761; --faint: #87928c;
  --line: #e4e0d6; --line-2: #d2cdc0;
  --accent: #2b5b4b; --accent-2: #214a3c; --accent-ink: #ffffff; --btn: #2b5b4b; --btn-2: #214a3c; --btn-ink: #ffffff; --accent-soft: #e4eee9; --accent-line: #bcd2c8;
  --brand: #244c40; --brand-ink: #f4efe3; --brand-2: #2d5c4d;
  --gold: #9a6a24; --gold-soft: #f6ead3;
  --good: #286845; --good-bg: #e2f1e8; --warn: #85560a; --warn-bg: #fbefd3; --bad: #a3321f; --bad-bg: #f8e3de;
  --soft: var(--accent-soft);                       /* name the install card uses */
  --shadow-1: 0 1px 2px rgba(24,34,29,.05), 0 1px 1px rgba(24,34,29,.03);
  --shadow-2: 0 2px 4px rgba(24,34,29,.04), 0 14px 30px -16px rgba(24,34,29,.28);
  --ring: 0 0 0 3px rgba(43,91,75,.30);
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1411; --bg-2: #151b18;
    --panel: #18201c; --panel-2: #1c2521;
    --ink: #edf1ee; --ink-2: #d0d8d3; --muted: #a0aca5; --faint: #77837d;
    --line: #26312b; --line-2: #33403a;
    --accent: #7fc0a8; --accent-2: #9bd0bb; --accent-ink: #0a1812; --btn: #3a7a63; --btn-2: #468a72; --btn-ink: #ffffff; --accent-soft: #1b2a24; --accent-line: #2d473c;
    --brand: #16251f; --brand-ink: #eee8da; --brand-2: #1d3128;
    --gold: #e0b46c; --gold-soft: #2f2616;
    --good: #8ed2a5; --good-bg: #1a2f23; --warn: #e6c36e; --warn-bg: #322a15; --bad: #f09a88; --bad-bg: #371f1b;
    --shadow-1: 0 1px 2px rgba(0,0,0,.35);
    --shadow-2: 0 2px 4px rgba(0,0,0,.3), 0 16px 34px -16px rgba(0,0,0,.7);
    --ring: 0 0 0 3px rgba(127,192,168,.38);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -.012em; line-height: 1.04; font-size: clamp(34px, 7vw, 46px); margin: 0; }
.display em { font-style: italic; color: var(--accent); }
.lede { color: var(--muted); font-size: 17px; line-height: 1.5; margin: 10px 0 0; max-width: 54ch; }
.hint { font-size: 14px; color: var(--muted); line-height: 1.4; margin: 0; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.flabel { display: block; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--ink-2); margin: 0 0 6px; }
.optional { font-weight: 500; color: var(--faint); }

/* ---------- icons ---------- */
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 24px; height: 24px; }
.ic .f { fill: currentColor; stroke: none; }

/* ---------- buttons ---------- */
.btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h); padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 600; font-size: 16px; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s, color .15s; }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .48; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 8px 18px -10px rgba(33,74,60,.75); }
.btn-primary:hover:not(:disabled) { background: var(--btn-2); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { opacity: 1; background: var(--bg-2); color: var(--faint); border-color: var(--line); }
.btn-primary:disabled .cost { background: var(--line); color: var(--faint); }
.btn-secondary { background: var(--panel); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn-secondary:hover:not(:disabled) { background: var(--panel-2); border-color: var(--faint); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-2); }
.btn-lg { --h: 56px; font-size: 17px; border-radius: 16px; padding: 0 24px; }
.btn-sm { --h: 38px; font-size: 14px; border-radius: 11px; padding: 0 14px; }
.btn-block { width: 100%; }
.btn .cost { font-weight: 600; font-size: 13px; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.18); }
.btn-secondary .cost, .btn-ghost .cost { background: var(--bg-2); }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; flex: none; }
.iconbtn:hover { background: var(--bg-2); color: var(--ink); }

/* ---------- cards, steps ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-1); }
.step { padding: 18px; }
.step + .step { margin-top: 14px; }
.step-h { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; margin-top: 1px; }
.step-h h2 { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.005em; }
.step-h .hint { margin-top: 2px; }

/* ---------- fields ---------- */
.input, .textarea, .select { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.4; transition: border-color .15s, box-shadow .15s; }
.textarea { resize: vertical; min-height: 92px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2387928c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field + .field { margin-top: 14px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -2px; padding: 2px 28px 2px 2px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent); }
.chips.scroll::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .chips.scroll { flex-wrap: wrap; overflow: visible; padding: 2px; -webkit-mask-image: none; mask-image: none; } }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; flex: none; scroll-snap-align: start; transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .ic { width: 15px; height: 15px; }

/* switch row */
.switchrow { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 12px 0 0; cursor: pointer; }
.switchrow .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.switchrow .s { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
.switch { flex: none; position: relative; width: 50px; height: 30px; border-radius: 99px; background: var(--line-2); border: 0; cursor: pointer; transition: background .18s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .18s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* disclosure */
.fold { border-top: 1px solid var(--line); }
.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 0; cursor: pointer; font-weight: 600; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .ic { transition: transform .18s; color: var(--muted); }
.fold[open] > summary .ic { transform: rotate(180deg); }
.fold-body { padding-top: 14px; }

/* badges and notices */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 99px; line-height: 1.2; }
.badge .ic { width: 15px; height: 15px; }
.badge.pass { background: var(--good-bg); color: var(--good); }
.badge.fail { background: var(--warn-bg); color: var(--warn); }
.badge.quiet { background: var(--bg-2); color: var(--muted); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.notice .ic { margin-top: 1px; color: var(--muted); }
.notice.err { background: var(--bad-bg); color: var(--bad); } .notice.err .ic { color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); } .notice.warn .ic { color: var(--warn); }

/* spinner + skeleton */
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.shimmer { position: relative; overflow: hidden; background: var(--bg-2); }
.shimmer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.35) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.6s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { .shimmer::after { background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.07) 50%, transparent 80%); } }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- before/after slider ---------- */
.cmp { position: relative; overflow: hidden; border-radius: 16px; background: var(--bg-2); line-height: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; outline-offset: 3px; }
.cmp img { width: 100%; display: block; pointer-events: none; -webkit-user-drag: none; }
.cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.cmp-tag { position: absolute; top: 12px; font-size: 12px; font-weight: 650; letter-spacing: .02em; padding: 5px 10px; border-radius: 99px; background: rgba(16,22,19,.62); color: #fff; line-height: 1.2; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }
.cmp-tag.l { left: 12px; } .cmp-tag.r { right: 12px; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 0 12px rgba(0,0,0,.35); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #fff; color: #1b2a24; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); line-height: 1; }
.cmp-knob .ic { width: 22px; height: 22px; stroke-width: 2; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 99px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 720px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .spin { animation: none; border-top-color: var(--line-2); border-right-color: var(--accent); }
}
