/* ===========================================================================
   Open House Engine — visitor sign-in
   Design law: built for the VISITOR's conversion, not the builder's taste.
   Light, fast, trust-forward, mobile-first. One action color. Big touch targets.
   =========================================================================== */

:root {
  --ink: #14181f;
  --ink-soft: #4a5360;
  --ink-faint: #8a93a1;
  --line: #e7e9ee;
  --surface: #ffffff;
  --canvas: #f6f7f9;
  --accent: #1f6feb;          /* single action color */
  --accent-press: #185fce;
  --success: #15803d;
  --danger: #d22f2f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 1px 2px rgba(20,24,31,.04), 0 12px 32px -12px rgba(20,24,31,.18);
  --tap: 56px;                /* min touch target */
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 560px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.stage {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* ---------- Offline banner ---------- */
.net-banner {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: #fff7e6; color: #8a5a00;
  border: 1px solid #f3d699; border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 12px; font-size: 14px; font-weight: 600;
}
.net-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: #e6a700; }

/* ---------- Hero / property card ---------- */
.hero {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.hero__media { position: relative; aspect-ratio: 16 / 10; background: #dfe3e8; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(10,14,20,.55) 100%);
}
.hero__price {
  position: absolute; left: 14px; bottom: 12px;
  color: #fff; font-size: 26px; font-weight: 700; letter-spacing: -.01em;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.hero__meta { padding: 16px 18px 18px; }
.hero__addr {
  font-family: var(--serif);
  font-size: 23px; line-height: 1.2; margin: 0 0 2px;
  letter-spacing: -.01em; font-weight: 600;
}
.hero__sub { margin: 0; color: var(--ink-soft); font-size: 15px; }

.agent { display: flex; align-items: center; gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.agent[hidden] { display: none; }
.agent__photo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--canvas); border: 1px solid var(--line); }
.agent__photo:not([src]) { display: none; }
.agent__text { display: flex; flex-direction: column; line-height: 1.25; }
.agent__name { font-weight: 650; font-size: 15px; }
.agent__brokerage { color: var(--ink-faint); font-size: 13px; }

/* ---------- Card / form ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 18px 24px;
}
.card__head { margin-bottom: 18px; }
.card__title { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; font-weight: 600; letter-spacing: -.01em; }
.card__hint { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field label .opt { color: var(--ink-faint); font-weight: 500; }
.field input {
  width: 100%; height: var(--tap);
  font-size: 17px; /* >=16px stops iOS zoom */
  font-family: inherit; color: var(--ink);
  background: var(--canvas);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 15px;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus {
  outline: none; background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31,111,235,.13);
}
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(210,47,47,.10); }
.field__note { margin: 7px 2px 0; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- Choice chips ---------- */
.choice { border: 0; padding: 0; margin: 0 0 16px; }
.choice legend { font-size: 14px; font-weight: 600; margin-bottom: 9px; padding: 0; }
.choice__row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  flex: 1 1 auto; min-width: calc(50% - 5px);
  min-height: 50px; padding: 0 14px;
  font-family: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--canvas); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .12s; -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(.985); }
.chip[aria-pressed="true"] {
  background: rgba(31,111,235,.08); border-color: var(--accent); color: var(--accent);
}

.consent {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 20px; cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* ---------- Submit ---------- */
.submit {
  position: relative; width: 100%; height: 60px;
  font-family: inherit; font-size: 17.5px; font-weight: 700; color: #fff;
  background: var(--accent); border: 0; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s, transform .08s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.submit:hover { background: var(--accent-press); }
.submit:active { transform: scale(.99); }
.submit[disabled] { opacity: .7; cursor: progress; }
.submit__spin { width: 19px; height: 19px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: none; animation: spin .7s linear infinite; }
.submit.loading .submit__spin { display: inline-block; }
.submit.loading .submit__label { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error { margin: 12px 0 0; color: var(--danger); font-size: 14px; font-weight: 600; text-align: center; }

/* ---------- Success ---------- */
.done {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 44px 24px 40px; text-align: center;
}
.done__check { width: 84px; height: 84px; margin: 0 auto 18px; }
.done__check svg { width: 100%; height: 100%; }
.done__check circle { stroke: var(--success); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .5s ease-out forwards; }
.done__check path { stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .35s .35s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__title { font-family: var(--serif); font-size: 27px; margin: 0 0 8px; font-weight: 600; }
.done__msg { margin: 0 auto; max-width: 340px; color: var(--ink-soft); font-size: 16px; }
.done__next { margin-top: 28px; }
.done__countdown { margin-top: 16px; color: var(--ink-faint); font-size: 13px; }

.ghost {
  height: 54px; padding: 0 26px; font-family: inherit; font-size: 16px; font-weight: 650;
  color: var(--accent); background: rgba(31,111,235,.08); border: 1.5px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer;
}
.ghost:hover { background: rgba(31,111,235,.14); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 22px 16px 8px; color: var(--ink-faint); font-size: 12px; }

/* ===========================================================================
   KIOSK MODE — tablet at the door. Bigger everything, no scroll fighting.
   =========================================================================== */
body[data-mode="kiosk"] { --maxw: 720px; background: var(--canvas); }
body[data-mode="kiosk"] .stage { padding-top: 28px; }
body[data-mode="kiosk"] .card__title { font-size: 28px; }
body[data-mode="kiosk"] .card__hint { font-size: 16.5px; }
body[data-mode="kiosk"] .field input { height: 64px; font-size: 19px; }
body[data-mode="kiosk"] .chip { min-height: 60px; font-size: 17.5px; }
body[data-mode="kiosk"] .submit { height: 70px; font-size: 20px; }
body[data-mode="kiosk"] .hero__addr { font-size: 28px; }
/* kiosk hides the visitor's-own-device niceties */
body[data-mode="kiosk"] .footer { display: none; }

@media (min-width: 600px) {
  .stage { padding-top: 28px; }
}

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