/* CLEAResult house style, shared with bpi.brenergy.net: white ground, one red
   accent, Barlow superfamily, the red rule across the top. */
:root {
  --paper: #ffffff;
  --surface: oklch(97% 0.004 60);
  --hairline: oklch(88% 0.006 60);
  --ink: oklch(25% 0.01 60);
  --ink-dim: oklch(48% 0.012 60);
  /* wordmark red sampled from the CLEAResult mark, (215, 57, 39) */
  --red: #d73927;
  --red-deep: #b32f1f;
  --red-tint: #fcebe8;
  --radius-control: 4px;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  border-top: 4px solid var(--red);
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  margin: 0 0 16px;
}

.logo {
  width: 180px;
  height: auto;
  display: block;
  margin: 24px 0 20px;
}

.lede {
  margin: 0 0 24px;
  color: var(--ink-dim);
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.radio-row:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* each question block is a bordered group with its prompt as the legend */
.group {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0 0 24px;
  padding: 16px 0 0;
}

legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
  padding: 0;
  margin: 0 0 12px;
}

.field {
  margin: 0 0 16px;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
  margin: 0 0 6px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
}

textarea {
  min-height: auto;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--red);
  outline-offset: 0;
}

.field.invalid input {
  border-color: var(--red);
}

/* radio rows mirror bpi's option-row: hidden native input, drawn mark, red-tint
   on the selected row */
.radio-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: var(--radius-control);
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}

label.radio-row {
  font-size: 16px;
}

.radio-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.radio-mark {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink-dim);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.radio-row:has(input:checked) {
  background: var(--red-tint);
}

.radio-row:has(input:checked) .radio-mark {
  border-color: var(--red);
}

.radio-row:has(input:checked) .radio-mark::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
}

.radio-text {
  line-height: 1.3;
}

.error {
  color: var(--red);
  font-size: 13px;
  margin: 6px 0 0;
  min-height: 0;
}

.error:empty {
  display: none;
}

.form-error {
  color: var(--red);
  font-weight: 600;
  margin: 0 0 16px;
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  background: var(--red);
  color: var(--paper);
  border: 0;
  border-radius: var(--radius-control);
  font-weight: 600;
  padding: 0 24px;
}

.btn-primary:hover {
  background: var(--red-deep);
}

.btn-primary:disabled {
  background: var(--surface);
  color: var(--ink-dim);
  cursor: not-allowed;
}

.btn-text {
  min-height: 48px;
  background: none;
  color: var(--red);
  border: 0;
  border-radius: var(--radius-control);
  font-weight: 600;
  padding: 0 12px;
}

.success-head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 24px 0 8px;
}

@media (min-width: 640px) {
  #app {
    padding-top: 32px;
  }

  .btn-primary {
    width: 220px;
  }
}
