/*
 * Tapknock visitor styles.
 *
 * A direct translation of the Material 3 design canvases, with the values taken
 * from them rather than approximated: primary #0b57d0, surface #fdfbff, the
 * 18/28/999 radius set, Roboto for text and Roboto Mono for anything that gets
 * read aloud.
 *
 * Light-only on purpose. This is read outdoors, in daylight, on whatever phone
 * the visitor happens to own, and a dark variant would be a second thing to get
 * right for no one's benefit.
 */

:root {
  --primary: #0b57d0;
  --on-primary: #ffffff;
  --primary-container: #d3e3fd;
  --on-primary-container: #041e49;

  --surface: #fdfbff;
  --surface-container: #f3f3fa;
  --surface-variant: #eef0f7;
  --on-surface: #1a1b21;
  --on-surface-variant: #44464f;
  --outline: #c4c6d0;
  --outline-variant: #e2e2e9;
  --muted: #74777f;

  --success-container: #c8ebd6;
  --on-success-container: #0f5132;
  --warn-container: #ffdfa0;
  --on-warn-container: #291c00;
  --error: #b3261e;

  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-full: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  /* Stops the rubber-band scroll revealing the page behind a full-screen call. */
  overscroll-behavior: none;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- header */

.brand {
  padding: 18px 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
/* The mark is a door with a handle — drawn, not an image, so it stays crisp. */
.brand__door {
  width: 13px; height: 18px;
  border-radius: 5px 5px 1px 1px;
  background: #fff;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 2px;
}
.brand__knob { width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--primary); }
.brand__name {
  font: 500 14px/1 Roboto, sans-serif;
  letter-spacing: .01em;
  color: var(--on-surface-variant);
}

.eyebrow {
  font: 500 11px/1 Roboto, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.label-sm {
  font: 500 12px/1 Roboto, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.place { padding: 24px 16px 0; }
.place__name {
  font: 400 32px/1.25 Roboto, sans-serif;
  color: var(--on-surface);
  margin-top: 8px;
}
.place__address {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  padding: 7px 14px 7px 11px;
  border-radius: var(--r-full);
  background: var(--success-container);
  font: 500 13.5px/1 Roboto, sans-serif;
  color: var(--on-success-container);
}
.place__address .pin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--on-success-container);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.place__address .pin i { width: 5px; height: 5px; border-radius: 50%; background: var(--on-success-container); display: block; }

/* ------------------------------------------------------------ note card */

.note {
  margin: 20px 16px 0;
  border-radius: var(--r-lg);
  padding: 22px 24px;
  background: var(--primary-container);
}
.note__head { display: flex; align-items: center; gap: 10px; }
.note__icon {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.note__icon i { width: 9px; height: 12px; border-radius: 4px 4px 1px 1px; background: var(--primary-container); display: block; }
.note__label { font: 500 12px/1 Roboto, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--on-primary-container); }
.note__body { font: 400 22px/1.4 Roboto, sans-serif; color: var(--on-primary-container); margin-top: 14px; }

/* --------------------------------------------------------------- chips */

.section { padding: 26px 16px 0; }
.section__label { font: 500 14px/1 Roboto, sans-serif; color: var(--on-surface-variant); }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.chip {
  height: 56px;
  border-radius: var(--r-md);
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font: 500 16px Roboto, sans-serif;
  color: var(--on-surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip[aria-checked="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.chip__dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255,255,255,.28);
  display: none; align-items: center; justify-content: center; flex: none;
}
.chip[aria-checked="true"] .chip__dot { display: flex; }
.chip__dot i { width: 7px; height: 7px; border-radius: 50%; background: #fff; display: block; }

/* --------------------------------------------------- filled text field */

.field {
  height: 60px;
  border-radius: var(--r-sm) var(--r-sm) 4px 4px;
  background: var(--surface-variant);
  border: none;
  border-bottom: 2px solid var(--outline);
  display: flex; flex-direction: column; justify-content: center;
  padding: 8px 16px;
  transition: border-color .12s;
}
.field:focus-within { border-bottom-color: var(--primary); }
.field__label { font: 400 11.5px/1 Roboto, sans-serif; color: var(--on-surface-variant); }
.field:focus-within .field__label { color: var(--primary); }
.field input, .field textarea {
  border: none; background: none; outline: none; padding: 0;
  font: 400 16px/1.2 Roboto, sans-serif;
  color: var(--on-surface);
  margin-top: 5px;
  width: 100%;
  resize: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field--area { height: auto; }
.field--area textarea { min-height: 96px; }

/* -------------------------------------------------------- consent card */

.consent {
  margin: 22px 16px 0;
  border-radius: var(--r-lg);
  background: var(--surface-container);
  padding: 20px 22px;
}
.consent__list { display: flex; flex-direction: column; margin-top: 16px; }
.consent__row {
  display: flex; gap: 16px; align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--outline-variant);
  font: 400 16px/1.35 Roboto, sans-serif;
  color: var(--on-surface);
}
.consent__row:first-child { border-top: none; padding-top: 0; }
.consent__row:last-child { padding-bottom: 0; }
.consent__row--key { font-weight: 500; color: var(--on-primary-container); }
.consent__row--muted { color: var(--on-surface-variant); }
.consent__icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--outline-variant);
  display: flex; align-items: center; justify-content: center;
  flex: none; position: relative;
}
.consent__icon--key { background: var(--primary-container); gap: 3px; }
.consent__icon--ok { background: var(--success-container); }

.footnote {
  padding: 14px 20px 0;
  font: 400 13px/1.5 Roboto, sans-serif;
  color: var(--on-surface-variant);
  margin-bottom: 26px;
}

.spacer { flex: 1; min-height: 0; }

/* ------------------------------------------------------- slide to ring */

.dock {
  position: sticky; bottom: 0; z-index: 2;
  flex: none;
  padding: 14px 16px 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--outline-variant);
}

/*
 * Slide, not tap.
 *
 * Ringing a stranger's door puts your face on their screen, and a slider makes
 * that a deliberate act rather than something a pocket can do by accident.
 */
.slider {
  position: relative;
  height: 72px;
  border-radius: 36px;
  background: var(--primary-container);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.slider__fill { position: absolute; inset: 0 auto 0 0; background: var(--primary); width: 0; }
.slider__label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding-left: 40px;
  pointer-events: none;
  font: 500 17px/1 Roboto, sans-serif;
  letter-spacing: .01em;
  color: var(--on-primary-container);
}
.slider__knob {
  position: absolute; top: 6px; left: 6px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.slider[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.slider.is-armed .slider__label { color: var(--on-primary); }

.dock__note { margin-top: 12px; text-align: center; font: 400 12.5px/1.4 Roboto, sans-serif; color: var(--muted); }

/* -------------------------------------------------------------- buttons */

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 56px;
  border: none; border-radius: var(--r-md);
  font: 500 16px Roboto, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn--filled { background: var(--primary); color: var(--on-primary); }
.btn--tonal { background: var(--surface-variant); color: var(--on-surface); border: 1px solid var(--outline); }
.btn--danger { background: var(--error); color: #fff; }
.btn--text { background: none; color: var(--primary); height: 48px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* --------------------------------------------------------------- cards */

.card { margin: 20px 16px 0; border-radius: var(--r-lg); padding: 20px 22px; background: var(--surface-container); }
.card--warn { background: var(--warn-container); color: var(--on-warn-container); }
.card--ok { background: var(--success-container); color: var(--on-success-container); }
.card--tonal { background: var(--primary-container); color: var(--on-primary-container); }

.alert {
  margin: 16px 16px 0;
  border-radius: var(--r-md);
  padding: 14px 16px;
  background: #fceeee;
  color: var(--error);
  font: 400 14px/1.45 Roboto, sans-serif;
}

.mono { font-family: "Roboto Mono", ui-monospace, monospace; }

/* ------------------------------------------------------- centred pages */

.centre {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 24px;
  max-width: 480px; margin: 0 auto;
  text-align: center;
}
.centre h1 { font: 400 28px/1.25 Roboto, sans-serif; margin: 0; }
.centre p { font: 400 16px/1.5 Roboto, sans-serif; color: var(--on-surface-variant); margin: 12px 0 0; }
.centre .brand { justify-content: center; padding: 0 0 28px; }

.badge-dot {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
}

/* ---------------------------------------------------------- call view */

.call {
  position: fixed; inset: 0;
  background: #000;
  color: #fff;
  display: flex; flex-direction: column;
}
.call__self {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* Mirrored: every camera app does, and an unmirrored preview reads as broken. */
  transform: scaleX(-1);
  opacity: .9;
}
.call__scrim { position: absolute; inset: 0; background: linear-gradient(#000c, #0000 45%, #000b); }
.call__head { position: relative; padding: 40px 20px 0; text-align: center; }
.call__status { font: 400 14px/1 Roboto, sans-serif; color: rgba(255,255,255,.72); }
.call__place { font: 400 22px/1.3 Roboto, sans-serif; margin-top: 8px; }
.call__clock {
  position: relative;
  margin-top: 28px;
  text-align: center;
  font: 300 64px/1 "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.call__hint { position: relative; margin-top: auto; padding: 0 28px 24px; text-align: center; font: 400 14px/1.5 Roboto, sans-serif; color: rgba(255,255,255,.72); }
.call__dock { position: relative; padding: 0 16px 28px; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.call__end {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--error); color: #fff;
  border: none; margin: 0 auto; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ front page

   The placeholder site. Deliberately built from the same tokens as the visitor
   pages, so the designed version replaces one block rather than arriving as a
   second stylesheet that slowly disagrees with this one. */

.lp {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.lp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 64px;
}

.lp-beta {
  font: 500 11px/1 "Roboto Mono", ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-lg, 999px);
  padding: 7px 12px;
  white-space: nowrap;
}

.lp-hero { max-width: 34ch; margin-bottom: 72px; }

.lp-hero h1 {
  font-size: clamp(38px, 8vw, 62px);
  font-weight: 300;
  letter-spacing: -.03em;
  line-height: 1.03;
  margin: 0 0 22px;
  text-wrap: balance;
}

.lp-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--on-surface-variant);
  margin: 0 0 14px;
  max-width: 46ch;
}

.lp-sub {
  font-size: 15px;
  color: var(--on-surface-variant);
  margin: 0;
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 34px 40px;
  margin-bottom: 76px;
}

.lp-point h3 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -.005em;
}

.lp-point p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--on-surface-variant);
}

.lp-how { margin-bottom: 72px; }

.lp-how h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin: 0 0 22px;
}

.lp-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lp-steps li {
  counter-increment: step;
  position: relative;
  padding: 18px 0 18px 46px;
  border-top: 1px solid var(--outline-variant);
  font-size: 16px;
  color: var(--on-surface-variant);
}

.lp-steps li:last-child { border-bottom: 1px solid var(--outline-variant); }

.lp-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 18px;
  font: 500 13px/1 "Roboto Mono", ui-monospace, monospace;
  color: var(--primary);
}

.lp-steps span { color: var(--on-surface); font-weight: 500; }

.lp-foot {
  border-top: 1px solid var(--outline-variant);
  padding-top: 24px;
}

.lp-foot p { margin: 0 0 6px; font-size: 14px; color: var(--on-surface-variant); }
.lp-quiet { color: var(--muted, var(--on-surface-variant)); font-size: 13px; }

@media (max-width: 560px) {
  .lp-head { margin-bottom: 44px; }
  .lp-hero { margin-bottom: 52px; }
  .lp-grid { gap: 28px; margin-bottom: 56px; }
}
