/* openhouse-mhe · MHE canonical brand (v1.0)
 *
 * Follows /Users/megroberts/Desktop/Meg - Drop/Matthew Hoult Estates/
 *   next-phase-design-system/css/design-tokens.css (imported).
 *
 * Pattern = "Private intake card", single page (no carousel):
 *   Paper ground · Sand card · mono index header · bottom-rule fields ·
 *   square corners · terracotta CTA · mono system voice.
 *
 * Open-house variant notes: this is filled standing up, on a phone or a
 * propped iPad, by someone who wants to go look at the house. Tap targets
 * are oversized, the yes/no branch is a pair of plates rather than radio
 * dots, and conditional blocks animate in so the page never feels long.
 */

@import url("/assets/design-tokens.css?v=1");

/* ─── Fonts (self-hosted, license present in Desktop drop) ─── */
@font-face {
  font-family: "Maison Neue";
  src: url("/assets/fonts/MaisonNeue-Light.otf") format("opentype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Maison Neue";
  src: url("/assets/fonts/MaisonNeue-Book.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Maison Neue";
  src: url("/assets/fonts/MaisonNeue-Medium.otf") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Maison Neue Mono";
  src: url("/assets/fonts/MaisonNeueMono.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ─── Base ─── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--mhe-paper);
  color: var(--mhe-ink);
  font-family: var(--mhe-font-sans);
  font-weight: var(--mhe-w-book);
  font-size: var(--mhe-fs-body);
  line-height: var(--mhe-lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  padding: var(--mhe-s5) var(--mhe-margin-mobile) var(--mhe-s8);
}

@media (min-width: 900px) {
  body { padding: var(--mhe-s7) var(--mhe-margin-desktop) var(--mhe-s9); }
}

/* ─── Layout shell ─── */
.container { max-width: 640px; margin: 0 auto; }

.header { margin-bottom: var(--mhe-s5); }

.brand {
  font-family: var(--mhe-font-sans);
  font-weight: var(--mhe-w-book);
  font-size: var(--mhe-fs-body);
  color: var(--mhe-ink);
  letter-spacing: 0;
  margin: 0 0 var(--mhe-s1) 0;
}

.tagline {
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-taupe);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin: 0;
}

/* ─── Type ─── */
h1 {
  font-family: var(--mhe-font-sans);
  font-weight: var(--mhe-w-light);
  font-size: var(--mhe-fs-h2);
  line-height: var(--mhe-lh-heading);
  letter-spacing: var(--mhe-track-display);
  margin: var(--mhe-s4) 0 var(--mhe-s3);
  color: var(--mhe-ink);
  max-width: 20ch;
}

.section-intro {
  font-size: var(--mhe-fs-body);
  color: var(--mhe-taupe);
  line-height: var(--mhe-lh-body);
  margin: 0 0 var(--mhe-s6);
  max-width: 46ch;
}

/* ─── Intake card (Sand plate on Paper ground) ─── */
.intake {
  background: var(--mhe-sand);
  border: var(--mhe-rule);
  padding: var(--mhe-s6) var(--mhe-s5);
  border-radius: var(--mhe-radius-0);
}

@media (min-width: 640px) {
  .intake { padding: var(--mhe-s7) var(--mhe-s6); }
}

.intake-index {
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-taupe);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  display: flex;
  justify-content: space-between;
  gap: var(--mhe-s4);
  border-bottom: var(--mhe-rule);
  padding-bottom: var(--mhe-s3);
  margin-bottom: var(--mhe-s5);
}

/* ─── The property line: fixed, not an input ───
 * Shown as a stated fact rather than a prefilled text box, so nobody
 * stops to wonder whether they are supposed to edit it. */
.property-line {
  border-bottom: var(--mhe-rule);
  padding-bottom: var(--mhe-s4);
  margin-bottom: var(--mhe-s6);
}

.property-line .property-label {
  display: block;
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-taupe);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-bottom: var(--mhe-s2);
}

.property-line .property-value {
  font-family: var(--mhe-font-sans);
  font-weight: var(--mhe-w-book);
  font-size: var(--mhe-fs-body-lg);
  color: var(--mhe-ink);
  line-height: 1.3;
}

/* ─── Fields (bottom-rule, no boxes) ─── */
.field { margin-bottom: var(--mhe-s5); }

.field > label:not(.plate),
fieldset > legend {
  display: block;
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  font-weight: var(--mhe-w-book);
  color: var(--mhe-taupe);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-bottom: var(--mhe-s2);
  transition: color var(--mhe-dur-ui) var(--mhe-ease);
}

.field:focus-within > label:not(.plate) { color: var(--mhe-accent-text); }

.field .hint {
  display: block;
  font-size: var(--mhe-fs-caption);
  color: var(--mhe-mute);
  margin-top: var(--mhe-s2);
  line-height: var(--mhe-lh-body);
}

.field .optional-tag {
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-faint);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-left: var(--mhe-s2);
}

input[type=text],
input[type=email],
input[type=tel],
textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--mhe-hairline);
  border-radius: 0;
  padding: var(--mhe-s3) 0;
  color: var(--mhe-ink);
  font-family: var(--mhe-font-sans);
  font-weight: var(--mhe-w-book);
  font-size: 16px; /* 16px minimum stops iOS Safari zooming on focus */
  line-height: var(--mhe-lh-body);
  min-height: 48px;
  transition: border-color var(--mhe-dur-ui) var(--mhe-ease);
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--mhe-ink);
  padding-bottom: calc(var(--mhe-s3) - 1px);
}

input::placeholder,
textarea::placeholder {
  color: var(--mhe-faint);
  font-style: normal;
}

textarea { resize: vertical; min-height: 84px; padding-top: var(--mhe-s2); }

/* Field flagged by validation */
.field.invalid input { border-bottom-color: var(--mhe-negative); }
.field .error-line {
  display: none;
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-negative);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-top: var(--mhe-s2);
}
.field.invalid .error-line { display: block; }

/* ─── Plate choices ───
 * Oversized tap plates for the branch questions. Faster than radio dots
 * with a thumb, and reads as a decision rather than a form control. */
fieldset {
  border: 0;
  margin: 0 0 var(--mhe-s5);
  padding: 0;
}

.plates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--mhe-s2);
}

.plates.stack { grid-template-columns: 1fr; }

.plate {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 56px;
  padding: var(--mhe-s3) var(--mhe-s3);
  background: var(--mhe-paper);
  border: 1px solid var(--mhe-hairline);
  border-radius: var(--mhe-radius-0);
  cursor: pointer;
  font-family: var(--mhe-font-sans);
  font-size: var(--mhe-fs-body);
  line-height: 1.25;
  color: var(--mhe-ink);
  transition: background var(--mhe-dur-ui) var(--mhe-ease),
              border-color var(--mhe-dur-ui) var(--mhe-ease),
              color var(--mhe-dur-ui) var(--mhe-ease);
  -webkit-tap-highlight-color: transparent;
}

.plate input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.plate:hover { border-color: var(--mhe-taupe); }

.plate:has(input:checked) {
  background: var(--mhe-accent);
  border-color: var(--mhe-accent);
  color: var(--mhe-on-accent);
}

.plate:has(input:focus-visible) {
  outline: var(--mhe-focus-ring);
  outline-offset: 2px;
}

fieldset.invalid .plates .plate { border-color: var(--mhe-negative); }
fieldset .error-line {
  display: none;
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-negative);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-top: var(--mhe-s2);
}
fieldset.invalid .error-line { display: block; }

/* ─── Conditional blocks ─── */
.branch[hidden] { display: none; }

.branch {
  animation: reveal var(--mhe-dur-reveal) var(--mhe-ease);
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* A branch reads as a nested aside, not a new form */
.branch-inner {
  border-left: 2px solid var(--mhe-hairline-deep);
  padding-left: var(--mhe-s4);
  margin-bottom: var(--mhe-s5);
}

.branch-title {
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-taupe);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin: 0 0 var(--mhe-s4);
}

/* ─── Divider between blocks ─── */
.rule {
  border: 0;
  border-top: var(--mhe-rule);
  margin: var(--mhe-s6) 0;
}

/* ─── Actions ─── */
.actions {
  margin-top: var(--mhe-s6);
  padding-top: var(--mhe-s5);
  border-top: var(--mhe-rule);
}

button {
  font-family: var(--mhe-font-sans);
  font-weight: var(--mhe-w-book);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 18px 30px;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 56px;
  transition: background var(--mhe-dur-ui) var(--mhe-ease),
              color var(--mhe-dur-ui) var(--mhe-ease),
              border-color var(--mhe-dur-ui) var(--mhe-ease),
              transform var(--mhe-dur-tap) var(--mhe-ease);
}

button:focus-visible { outline: var(--mhe-focus-ring); outline-offset: 2px; }

button.primary {
  width: 100%;
  background: var(--mhe-accent);
  color: var(--mhe-on-accent);
  border-color: var(--mhe-accent);
}

button.primary:hover { background: var(--mhe-accent-text); border-color: var(--mhe-accent-text); }
button.primary:active { transform: translateY(1px); }

button.primary:disabled {
  background: var(--mhe-taupe);
  border-color: var(--mhe-taupe);
  color: var(--mhe-on-accent);
  opacity: 0.4;
  cursor: not-allowed;
}

.form-error {
  display: none;
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-negative);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-top: var(--mhe-s3);
  text-align: center;
}
.form-error.show { display: block; }

/* ─── Privacy note ─── */
.privacy-note {
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-legal);
  color: var(--mhe-taupe);
  line-height: var(--mhe-lh-mono);
  margin: var(--mhe-s6) 0 0;
  padding-top: var(--mhe-s4);
  border-top: var(--mhe-rule);
  letter-spacing: 0.02em;
}

/* ─── Confirmation screen ─── */
.centered-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.centered-page .card { max-width: 520px; padding: var(--mhe-s8) var(--mhe-s5); }

.icon-badge {
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-positive);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  margin-bottom: var(--mhe-s5);
  display: inline-block;
}

/* Kiosk mode: after a submit, the page offers to reset for the next
 * visitor instead of leaving the last person's details on screen. */
.reset-link {
  display: inline-block;
  margin-top: var(--mhe-s6);
  font-family: var(--mhe-font-mono);
  font-size: var(--mhe-fs-mono-label);
  color: var(--mhe-accent-text);
  text-transform: uppercase;
  letter-spacing: var(--mhe-track-caps);
  text-decoration: none;
  border-bottom: 1px solid var(--mhe-accent-text);
  padding-bottom: 2px;
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  .branch { animation: none; }
}
