/* Hearthleaf Early Access form + survey (landing/waitlist/waitlist.js). Mobile first.
   Everything is scoped under .hl-wl; the host page themes it by overriding the variables below
   (defaults = the Hearthleaf palette from CLAUDE.md / components/ui/theme.ts). */

.hl-wl {
  --hl-wl-primary: #00522c;
  --hl-wl-primary-hover: #003f22;
  --hl-wl-on-primary: #ffffff;
  --hl-wl-tint: #e3f0e8;
  --hl-wl-tint-light: #f3f8f4;
  --hl-wl-card: #ffffff;
  --hl-wl-text: #18241f;
  --hl-wl-text-2: #5f6d66;
  --hl-wl-border: #e1e7e2;
  --hl-wl-error: #c2574b;
  --hl-wl-radius: 12px;
  --hl-wl-font: inherit;

  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding: 20px 16px;
  background: var(--hl-wl-card);
  color: var(--hl-wl-text);
  border: 1px solid var(--hl-wl-border);
  border-radius: calc(var(--hl-wl-radius) + 4px);
  box-shadow: 0 1px 2px rgba(24, 36, 31, 0.04), 0 8px 24px rgba(24, 36, 31, 0.06);
  font-family: var(--hl-wl-font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  scroll-margin-top: 16px;
}
.hl-wl *,
.hl-wl *::before,
.hl-wl *::after {
  box-sizing: inherit;
}
/* The module toggles screens and fields with the hidden attribute; layout rules must not undo it. */
.hl-wl [hidden] {
  display: none !important;
}
@media (min-width: 600px) {
  .hl-wl {
    padding: 28px;
  }
}

.hl-wl-form,
.hl-wl-survey,
.hl-wl-done {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hl-wl-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-wrap: balance;
  outline: none;
}
.hl-wl-intro {
  margin: -8px 0 0;
  color: var(--hl-wl-text-2);
}
.hl-wl-survey-intro {
  margin: 0;
}

.hl-wl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hl-wl-label {
  font-size: 15px;
  font-weight: 600;
  padding: 0;
}
.hl-wl-optional {
  font-weight: 400;
  color: var(--hl-wl-text-2);
}
.hl-wl-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* 16px+: iOS Safari doesn't zoom into the field */
  color: var(--hl-wl-text);
  background: var(--hl-wl-card);
  border: 1px solid var(--hl-wl-border);
  border-radius: var(--hl-wl-radius);
  appearance: none;
  -webkit-appearance: none;
}
.hl-wl-input::placeholder {
  color: var(--hl-wl-text-2);
  opacity: 0.8;
}
.hl-wl-input:focus {
  outline: none;
  border-color: var(--hl-wl-primary);
  box-shadow: 0 0 0 3px var(--hl-wl-tint);
}
.hl-wl-input[aria-invalid='true'] {
  border-color: var(--hl-wl-error);
}
.hl-wl-input-zip {
  max-width: 160px;
  letter-spacing: 0.06em;
}
.hl-wl-hint {
  margin: 0;
  font-size: 14px;
  color: var(--hl-wl-text-2);
}
.hl-wl-hint:empty {
  display: none;
}
.hl-wl-error,
.hl-wl-form-error {
  margin: 0;
  font-size: 14px;
  color: var(--hl-wl-error);
}
.hl-wl-form-error {
  padding: 10px 12px;
  border-radius: var(--hl-wl-radius);
  background: color-mix(in srgb, var(--hl-wl-error) 9%, var(--hl-wl-card));
}

.hl-wl-city {
  margin-top: -6px;
  padding: 12px;
  border-radius: var(--hl-wl-radius);
  background: var(--hl-wl-tint-light);
}
.hl-wl-city-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hl-wl-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}
.hl-wl-choices legend {
  margin-bottom: 8px;
}
.hl-wl-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--hl-wl-border);
  border-radius: 999px;
  background: var(--hl-wl-card);
  cursor: pointer;
}
.hl-wl-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.hl-wl-chip:has(input:checked) {
  border-color: var(--hl-wl-primary);
  background: var(--hl-wl-tint);
  color: var(--hl-wl-primary);
  font-weight: 600;
}
.hl-wl-chip:has(input:focus-visible) {
  outline: 2px solid var(--hl-wl-primary);
  outline-offset: 2px;
}

.hl-wl-consent {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 15px;
  cursor: pointer;
}
.hl-wl-consent input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--hl-wl-primary);
}
.hl-wl-legal {
  margin: 0;
  font-size: 13px;
  color: var(--hl-wl-text-2);
}
.hl-wl a {
  color: var(--hl-wl-primary);
  text-underline-offset: 2px;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.hl-wl-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.hl-wl-challenge:empty {
  display: none;
}
.hl-wl-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hl-wl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  color: var(--hl-wl-on-primary);
  background: var(--hl-wl-primary);
  border: 1px solid var(--hl-wl-primary);
  border-radius: var(--hl-wl-radius);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hl-wl-button:hover:not(:disabled) {
  background: var(--hl-wl-primary-hover);
}
.hl-wl-button:focus-visible,
.hl-wl-option:focus-visible,
.hl-wl-link:focus-visible,
.hl-wl-back:focus-visible {
  outline: 2px solid var(--hl-wl-primary);
  outline-offset: 2px;
}
.hl-wl-button:disabled {
  opacity: 0.55;
  cursor: default;
}
.hl-wl-button-ghost {
  color: var(--hl-wl-primary);
  background: transparent;
  border-color: var(--hl-wl-border);
}
.hl-wl-button-ghost:hover:not(:disabled) {
  background: var(--hl-wl-tint-light);
}

/* Survey */
.hl-wl-survey-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: -8px 0 -8px;
}
.hl-wl-back,
.hl-wl-link {
  min-height: 44px;
  padding: 0 4px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--hl-wl-primary);
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.hl-wl-progress-text {
  font-size: 14px;
  color: var(--hl-wl-text-2);
  font-variant-numeric: tabular-nums;
}
.hl-wl-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--hl-wl-tint);
  overflow: hidden;
}
.hl-wl-progress i {
  display: block;
  height: 100%;
  background: var(--hl-wl-primary);
  border-radius: inherit;
  transition: width 0.25s ease;
}
.hl-wl-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hl-wl-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  text-align: left;
  color: var(--hl-wl-text);
  background: var(--hl-wl-card);
  border: 1px solid var(--hl-wl-border);
  border-radius: var(--hl-wl-radius);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.hl-wl-option:hover:not(:disabled) {
  border-color: var(--hl-wl-primary);
}
.hl-wl-option[aria-pressed='true'] {
  border-color: var(--hl-wl-primary);
  background: var(--hl-wl-tint);
  font-weight: 600;
}
.hl-wl-option:disabled:not([aria-pressed='true']) {
  opacity: 0.5;
  cursor: default;
}
.hl-wl-radio,
.hl-wl-check {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--hl-wl-border);
  background: var(--hl-wl-card);
}
.hl-wl-radio {
  border-radius: 50%;
}
.hl-wl-check {
  border-radius: 6px;
}
.hl-wl-option[aria-pressed='true'] .hl-wl-radio {
  border: 6px solid var(--hl-wl-primary);
}
.hl-wl-option[aria-pressed='true'] .hl-wl-check {
  border-color: var(--hl-wl-primary);
  background: var(--hl-wl-primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.hl-wl-survey-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.hl-wl-survey-actions .hl-wl-link {
  align-self: center;
  font-weight: 500;
  color: var(--hl-wl-text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Done */
.hl-wl-done {
  align-items: flex-start;
}
.hl-wl-done-icon {
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 50%;
  background: var(--hl-wl-tint);
  fill: none;
  stroke: var(--hl-wl-primary);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hl-wl-done .hl-wl-intro {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hl-wl * {
    transition: none !important;
  }
}
