:root {
  color-scheme: light;
  --ink: #28232b;
  --muted: #6c626b;
  --purple: #7044f5;
  --purple-text: #5733a0;
  --cream: #fff8f1;
  --line: #e6dde3;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .72; cursor: default; }
a { color: var(--purple-text); }
:where(a, button, input):focus-visible { outline: 3px solid #b59aff; outline-offset: 3px; }

.top {
  display: flex;
  justify-content: center;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
}

.logo { display: block; }
.logo img { display: block; width: 58px; height: auto; }

.entry {
  max-width: 458px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom) + var(--keyboard-space, 0px))
    max(16px, env(safe-area-inset-left));
}

.entry-card {
  overflow-wrap: anywhere;
  padding: 20px clamp(16px, 5vw, 26px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 6px 20px #5733a00a;
}

.entry-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 0 12px;
  border-radius: 14px;
  color: var(--purple-text);
  background: #f0e9ff;
}

.entry-mark svg, .proof svg, .check {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1 { margin: 0 0 6px; font-size: clamp(25px, 7vw, 31px); line-height: 1.13; letter-spacing: -.025em; }
#heading:focus { outline: none; }
.intro { margin: 0 0 17px; color: var(--muted); font-size: .925rem; }
.field { display: grid; gap: 5px; margin: 0 0 6px; }
.field label { font-weight: 650; font-size: .9rem; }

.field input:not([type=checkbox]) {
  width: 100%;
  min-height: 50px;
  padding: 10px 13px;
  border: 1px solid #b8aebf;
  border-radius: 13px;
  background: white;
  color: var(--ink);
  scroll-margin-block: 16px;
}

.field input:focus { border-color: var(--purple); }
.field + .field { margin-top: 12px; }
.show-password { display: flex; min-height: 44px; align-items: center; gap: 8px; }
.show-password input { width: 19px; height: 19px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: .8rem; }

.primary, .secondary, .text-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  font-weight: 650;
}

.primary, .secondary { width: 100%; border-radius: 14px; }
.primary { min-height: 49px; border: 1px solid transparent; background: var(--purple); color: white; }
.primary:not(:disabled):active { background: var(--purple-text); }
.secondary { margin-top: 8px; border: 1px solid #b8aebf; background: transparent; color: var(--purple-text); }
.text-button { border: 0; background: transparent; color: var(--purple-text); padding-inline: 0; }
.choices { display: grid; justify-items: center; }
.google-slot { display: flex; justify-content: center; min-height: 44px; width: 100%; }

.proof {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  margin: 0 0 10px;
  border-radius: 8px;
  background: #e9f5eb;
  color: #22613c;
  font-size: .8rem;
  font-weight: 650;
}

.proof svg { width: 16px; height: 16px; }
.status { margin: 10px 0 0; font-size: .88rem; }
.status:empty { display: none; }
.status.error { color: #96372e; }

#code { font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: .22em; }
#code-form .primary { margin-top: 13px; }
.destination { color: var(--ink); font-weight: 650; }
.code-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
.code-actions .text-button { font-size: .86rem; }

.ring {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.handoff { min-height: 200px; display: grid; place-content: center; justify-items: center; text-align: center; }
.handoff-mark { width: 34px; height: 34px; color: var(--purple-text); }
.handoff .check { padding: 5px; border-radius: 50%; color: #22613c; background: #e9f5eb; }
#handoff-title { margin: 14px 0 3px; font-size: 1.1rem; font-weight: 700; }
[data-handoff] .entry-card > :not(.handoff) { display: none !important; }
[data-entry-step=code] .entry-card, [data-entry-step=mobile] .entry-card { animation: enter .18s ease-out; }
@keyframes enter { from { opacity: .65; transform: translateY(4px); } }
[data-entry-step=code] .role-links, [data-entry-step=mobile] .role-links { display: none; }

.links { display: grid; justify-items: center; margin: 6px 0 0; font-size: .875rem; }
.links a { display: inline-grid; place-items: center; min-height: 44px; text-underline-offset: 3px; }
.owner-link { font-weight: 650; }
.role-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 16px; }
.terms { margin: 0; text-align: center; color: var(--muted); font-size: .78rem; }
.terms span { display: inline-block; white-space: nowrap; }
.terms a { display: inline-block; padding-block: 13px; }
[data-entry=signup] .login-only, [data-entry=login] .signup-only { display: none; }
[data-restoring] .entry > :not(.entry-card) { display: none; }
[data-handoff] .links, [data-handoff] .terms { display: none; }

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

@media(max-height:580px) and (max-width:720px) {
  body:has(#code-panel:not([hidden])) {align-content:start}
  #code-panel:not([hidden]) form {display:grid;gap:8px}
  #code-panel :is(input,button) {position:static;min-height:44px;font-size:1rem}
}
