/* ── Boot, access gate, and first-run configuration ──────────────────────── */

#boot, #lock, #onboarding {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 100;
}

/* Boot ------------------------------------------------------------------- */

#boot-log {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: var(--arc);
  margin: 0;
  min-width: 340px;
}
#boot-log .ok { color: var(--text-quiet); }

/* Access gate ------------------------------------------------------------ */

.lock-inner {
  width: min(300px, 84vw);
  text-align: center;
  position: relative;
  padding: 34px 30px 30px;
}
/* Corner brackets — an optical-instrument frame rather than a box. */
.lock-inner::before, .lock-inner::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid var(--rule-strong);
}
.lock-inner::before { top: 0; left: 0;  border-right: none; border-bottom: none; }
.lock-inner::after  { bottom: 0; right: 0; border-left: none;  border-top: none; }

#lock-dots {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 22px 0 26px;
}
#lock-dots i {
  width: 9px; height: 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  transition: all .22s var(--ease);
}
#lock-dots i.on {
  background: var(--phosphor);
  border-color: var(--phosphor);
  box-shadow: 0 0 12px rgba(127,233,245,.7);
}

#lock-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#lock-keypad button {
  aspect-ratio: 1;
  font-size: 15px;
  letter-spacing: 0;
  border-color: var(--rule);
}
#lock-keypad button:hover { border-color: var(--arc); }

#lock-error {
  min-height: 16px;
  margin: 20px 0 0;
  color: var(--alert);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.shake { animation: shake .38s var(--ease); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  60% { transform: translateX(7px); }
}

/* First-run configuration ------------------------------------------------ */

.onboard-inner { width: min(560px, 88vw); text-align: center; }

#onboarding-question {
  /* The one place the humane voice face is used at scale. */
  font-family: var(--sans);
  font-size: clamp(22px, 3.4vw, 31px);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 18px 0 30px;
  min-height: 84px;
}
#onboarding-progress {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 22px;
}
#onboarding-progress i {
  width: 26px; height: 2px; background: var(--rule-strong);
  transition: background .3s var(--ease);
}
#onboarding-progress i.done { background: var(--phosphor); }
#onboarding-hint { margin-top: 14px; font-size: 10px; letter-spacing: 0.16em; }

/* ── Welcome ───────────────────────────────────────────────────────────────
   Shown once the code is accepted. Its job is one decision: connect Google, or
   carry on without it. */
#welcome {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 40;
}
.welcome-inner {
  width: min(560px, 88vw);
  text-align: center;
  position: relative;
  padding: 42px 34px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
/* The same corner brackets as the keypad, so the two screens read as one system. */
.welcome-inner::before,
.welcome-inner::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid var(--arc);
  opacity: .55;
}
.welcome-inner::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.welcome-inner::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

#welcome-title {
  margin: 14px 0 10px;
  font-family: var(--sans);
  font-weight: 200;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -.01em;
  color: var(--text);
}
#welcome-sub {
  margin: 0 auto 26px;
  max-width: 42ch;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}
#welcome-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
#welcome-actions button {
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 12px 20px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
#welcome-actions .primary {
  border-color: var(--arc);
  color: var(--phosphor);
  background: color-mix(in srgb, var(--arc) 10%, transparent);
}
#welcome-actions button:hover:not(:disabled) { border-color: var(--phosphor); color: var(--phosphor); }
#welcome-actions button:disabled { opacity: .45; cursor: default; }
#welcome-actions button:focus-visible { outline: 1px solid var(--phosphor); outline-offset: 2px; }

#welcome-status { margin: 18px auto 0; max-width: 46ch; line-height: 1.5; }
#welcome-status.ok { color: var(--ok); }
#welcome-status.bad { color: var(--alert); }
#welcome-note { margin: 22px auto 0; max-width: 44ch; line-height: 1.6; }
