/*
 * Phone first. --brand and --font are set from site.config.json by the page.
 * The look: light gray page, white cards with a soft shadow, heavy dark
 * headings, small all-caps labels in the brand color, and all-caps buttons.
 */
:root {
  --brand: #1f5f8b;
  --brand-text: var(--brand);
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #ffffff);
  --on-brand: #ffffff;
  --font: Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: #f6f8fa;
  --card: #ffffff;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --field: #ffffff;
  --problem: #b3261e;
  --problem-bg: #fdf1f0;
  --radius: 12px;
  --shadow: 0 10px 30px -10px rgba(17, 24, 39, .14), 0 2px 6px -2px rgba(17, 24, 39, .06);
  --glow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 60%, transparent);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-text: color-mix(in srgb, var(--brand) 55%, #ffffff);
    --brand-soft: color-mix(in srgb, var(--brand) 18%, #1c1f23);
    --page: #111418;
    --card: #1c1f23;
    --ink: #f3f4f6;
    --text: #d1d5db;
    --muted: #9ca3af;
    --line: #353a41;
    --field: #23272c;
    --problem: #ff8a80;
    --problem-bg: #3a2322;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand-text: color-mix(in srgb, var(--brand) 55%, #ffffff);
  --brand-soft: color-mix(in srgb, var(--brand) 18%, #1c1f23);
  --page: #111418;
  --card: #1c1f23;
  --ink: #f3f4f6;
  --text: #d1d5db;
  --muted: #9ca3af;
  --line: #353a41;
  --field: #23272c;
  --problem: #ff8a80;
  --problem-bg: #3a2322;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
}

.page { max-width: 560px; margin: 0 auto; padding: 22px 16px 48px; }

/* Dark band across the top, like a site header over a photo. White logos sit on it. */
.band { background: #111827; }
.band__inner { max-width: 560px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: center; min-height: 64px; }
.band__logo { max-height: 40px; max-width: 70%; display: block; }
.band__name { font-weight: 900; font-size: 19px; color: #ffffff; letter-spacing: -.01em; }

.hello { padding: 0 2px; }
.hello h1 { font-size: 30px; line-height: 1.15; font-weight: 900; letter-spacing: -.02em; color: var(--ink); margin: 0 0 8px; }
.hello p { margin: 0 0 20px; color: var(--text); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 18px;
  position: relative;
  overflow: hidden;
}

.progress { position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line); }
.progress__bar { height: 100%; background: var(--brand); transition: width .25s ease; }

/* Small all-caps label above a heading. */
.step { margin: 4px 0 4px; font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-text); }
.section__title { margin: 0 0 4px; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--ink); outline: none; }
.section__intro { margin: 0 0 8px; color: var(--muted); }

.q { padding: 16px 0 4px; border-top: 1px solid transparent; }
.q + .q { border-top-color: var(--line); }
.q__label { display: block; margin: 0 0 8px; font-weight: 700; color: var(--ink); }
.q__optional { font-weight: 400; color: var(--muted); font-size: 14px; }
.q__hint { margin: -4px 0 8px; font-size: 14px; color: var(--muted); }
.q__problem { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--problem-bg); color: var(--problem); font-size: 14px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming in */
}
textarea { resize: vertical; min-height: 104px; }
input:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 1px; border-color: var(--brand); }
[aria-invalid="true"] { border-color: var(--problem); }

/* Choice chips: real radios and checkboxes, drawn as big tap targets. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span, .chip--add {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background-color .15s;
}
.chip span:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.chip--hint span { flex-direction: column; align-items: flex-start; line-height: 1.25; }
.chip span small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; }
.chip input:checked + span small { color: inherit; opacity: .85; }
.chip input:focus-visible + span, .chip--add:focus-visible, .level input:focus-visible + span, .button:focus-visible, .room__remove:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}
.chip--add { border-style: dashed; color: var(--brand-text); font-weight: 700; }
.chip--add:hover { background: var(--brand-soft); }
.chip--add:disabled { opacity: .45; cursor: not-allowed; }

/* Rooms */
.room-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.room { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--card); }
.room--missing { border-color: var(--problem); background: var(--problem-bg); }
.room__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.room__name { font-weight: 700; color: var(--ink); }
.room__remove {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.room__remove:hover { background: var(--page); }
.levels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.level { position: relative; display: flex; }
.level input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.level span {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 56px; padding: 6px 4px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--field);
  text-align: center; cursor: pointer; font-size: 14px; line-height: 1.2; color: var(--ink);
}
.level small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.level input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.level input:checked + span small { color: inherit; opacity: .85; }

.muted { color: var(--muted); font-size: 14px; margin: 10px 0 0; }

/* Navigation */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.button {
  min-height: 50px; padding: 14px 26px;
  border: 0; border-radius: 8px;
  background: var(--brand); color: var(--on-brand);
  box-shadow: var(--glow);
  font: inherit; font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer;
  transition: filter .15s;
}
.button:hover { filter: brightness(1.06); }
.button:disabled { opacity: .6; cursor: progress; }
.button--quiet { background: transparent; box-shadow: none; color: var(--muted); padding-inline: 8px; }
.nav .button:not(.button--quiet) { flex: 1; max-width: 300px; }

/* Spam trap: off-screen, never seen or tabbed to by a person. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card > h1 { font-size: 26px; line-height: 1.2; font-weight: 900; letter-spacing: -.02em; color: var(--ink); margin: 4px 0 8px; outline: none; }
.card > h1 ~ p { margin: 0; color: var(--text); }

/* Preview mode */
.preview__meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0; font-size: 14px; }
.preview__meta dt { color: var(--muted); }
.preview__meta dd { margin: 0; overflow-wrap: anywhere; }
.preview__frame { width: 100%; min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

@media (min-width: 600px) {
  .page { padding-top: 36px; }
  .card { padding: 28px 28px 24px; }
  .hello h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress__bar, .chip span, .button { transition: none; }
}
