/* AccessPark mobile demo. Colors come only from shared/brand.css tokens. */
:root {
  --tint: color-mix(in srgb, var(--ap-primary) 10%, var(--ap-surface));
  --line: color-mix(in srgb, var(--ap-ink) 10%, var(--ap-surface));
  --dark: color-mix(in srgb, var(--ap-ink) 92%, var(--ap-primary));
  --radius: 18px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: color-mix(in srgb, var(--ap-ink) 8%, var(--ap-bg));
  color: var(--ap-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Phone column */
.phone {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ap-bg);
  overflow: hidden;
}
@media (min-width: 600px) {
  body { display: flex; align-items: center; justify-content: center; padding: 24px; }
  .phone { min-height: 0; height: min(860px, calc(100dvh - 48px)); border-radius: 36px; box-shadow: 0 30px 80px color-mix(in srgb, var(--ap-ink) 30%, transparent); }
}

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.screen[data-active] { display: flex; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Type */
.display { margin: 6px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.1; letter-spacing: -0.01em; }
.display-sm { font-size: 30px; margin-top: 4px; }
.lead { margin: 8px 0 0; font-size: 15px; color: var(--ap-muted); line-height: 1.45; }
.muted { color: var(--ap-muted); font-size: 14px; }
.small { font-size: 14px; margin: 0; line-height: 1.45; }

/* Brand */
.brand { display: flex; align-items: center; min-height: 32px; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-small .brand-logo { height: 26px; }
.wordmark { font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ap-ink); letter-spacing: -0.01em; }
.wordmark b { color: var(--ap-primary); font-weight: 600; }
.brand-small .wordmark { font-size: 17px; }

/* Buttons */
.btn {
  height: 56px; width: 100%; border: none; border-radius: var(--radius);
  font-weight: 600; font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-xl { height: 64px; font-size: 18px; }
.btn-primary { background: var(--ap-primary); color: var(--ap-surface); }
.btn-primary:hover { background: var(--ap-primary-dark); }
.btn-secondary { background: var(--ap-surface); color: var(--ap-ink); border: 1px solid var(--line); }
.btn[disabled] { opacity: .75; cursor: progress; transform: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--ap-surface) 40%, transparent); border-top-color: var(--ap-surface); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: none; color: var(--ap-primary); font-weight: 500; font-size: 15px; min-height: 44px; padding: 0 4px; }
.link-center { width: 100%; }

/* Login */
#screen-login { padding: 72px 24px 32px; gap: 36px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ap-muted); }
.field input {
  height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--ap-surface);
  padding: 0 16px; font: inherit; font-size: 16px; color: var(--ap-ink);
}
.field input:focus { outline: 2px solid var(--ap-primary); outline-offset: 1px; border-color: transparent; }
.form-error { margin: 0; color: var(--ap-danger); font-size: 14px; }
.login-form .btn { margin-top: 8px; }

/* List */
.list-head { padding: 52px 24px 8px; }
.list-head-row { display: flex; align-items: center; justify-content: space-between; }
.banner {
  margin: 16px 16px 0; padding: 12px 14px; border-radius: 14px;
  background: var(--tint); color: var(--ap-primary-dark);
  display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4;
}
.banner svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.banner p { margin: 0; }
.cards { padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 12px; }
.card {
  text-align: left; width: 100%;
  background: var(--ap-surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .1s ease, box-shadow .15s ease;
}
.card:active { transform: scale(.985); }
.card:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--ap-ink) 8%, transparent); }
.card-row { display: flex; gap: 14px; align-items: center; }
.card-row-split { justify-content: space-between; }
.tile { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile svg { width: 24px; height: 24px; }
.card-title { font-weight: 600; font-size: 17px; }
.card-site { font-size: 14px; color: var(--ap-muted); }
.card-body { flex-grow: 1; min-width: 0; }
.chev { width: 20px; height: 20px; color: var(--ap-muted); flex-shrink: 0; }
.chip { font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.remote-tag { font-size: 13px; color: var(--ap-muted); display: flex; align-items: center; gap: 5px; }
.remote-tag svg { width: 15px; height: 15px; }

/* Access tones */
.tone-ok { background: color-mix(in srgb, var(--ap-success) 14%, var(--ap-surface)); color: color-mix(in srgb, var(--ap-success) 70%, var(--ap-ink)); }
.tone-hours { background: color-mix(in srgb, var(--ap-warning) 16%, var(--ap-surface)); color: color-mix(in srgb, var(--ap-warning) 65%, var(--ap-ink)); }
.tone-dates { background: color-mix(in srgb, var(--ap-primary) 12%, var(--ap-surface)); color: var(--ap-primary-dark); }

/* Detail */
.screen-dark { background: var(--dark); }
.detail-top { position: relative; min-height: 300px; flex: 1 0 auto; display: flex; flex-direction: column; color: color-mix(in srgb, var(--ap-surface) 80%, var(--dark)); }
.back-btn {
  position: absolute; top: 44px; left: 12px; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--ap-surface) 12%, transparent); border: none; color: var(--ap-surface);
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.back-btn svg { width: 22px; height: 22px; }
.detail-visual { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 76px 24px 20px; }
.gate-halo {
  width: 150px; height: 150px; border-radius: 36px;
  border: 3px solid color-mix(in srgb, var(--ap-primary) 60%, var(--ap-surface));
  color: color-mix(in srgb, var(--ap-primary) 50%, var(--ap-surface));
  display: flex; align-items: center; justify-content: center;
}
.gate-halo svg { width: 64px; height: 64px; stroke-width: 1.6; }
.detail-caption { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

.sheet {
  background: var(--ap-bg); border-radius: 28px 28px 0 0;
  padding: 12px 24px 32px; display: flex; flex-direction: column; gap: 18px;
}
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.checks svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--ap-success); }
.checks li.off { color: var(--ap-muted); }
.checks li.off svg { color: var(--ap-muted); }
.step { display: flex; flex-direction: column; gap: 12px; }
.option {
  width: 100%; text-align: left; min-height: 68px;
  background: var(--ap-surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 14px;
}
.option:active { transform: scale(.985); }
.option-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--ap-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.option-icon svg { width: 22px; height: 22px; }
.option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.option-text b { font-weight: 600; font-size: 16px; }
.option-text small { font-size: 13px; color: var(--ap-muted); }
.note { font-size: 14px; color: var(--ap-muted); display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.confirm-q { margin: 0; font-size: 18px; line-height: 1.35; }

/* Result */
#screen-result { padding: 0 24px 32px; }
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 48px; }
.result-icon { width: 112px; height: 112px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.result-icon svg { width: 56px; height: 56px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.result .lead { max-width: 300px; }
.result-meta { margin: 18px 0 0; font-size: 14px; color: var(--ap-muted); font-variant-numeric: tabular-nums; }
.result-actions { display: flex; flex-direction: column; gap: 10px; }

.r-success .result-icon { background: var(--ap-success); color: var(--ap-surface); }
.r-success #result-title { color: color-mix(in srgb, var(--ap-success) 75%, var(--ap-ink)); }
.r-denied .result-icon { background: color-mix(in srgb, var(--ap-danger) 14%, var(--ap-surface)); color: var(--ap-danger); }
.r-offline .result-icon { background: color-mix(in srgb, var(--ap-warning) 16%, var(--ap-surface)); color: var(--ap-warning); }
.r-error .result-icon { background: color-mix(in srgb, var(--ap-muted) 15%, var(--ap-surface)); color: var(--ap-muted); }
.r-auth .result-icon { background: color-mix(in srgb, var(--ap-primary) 12%, var(--ap-surface)); color: var(--ap-primary); }
#screen-result.r-success { background: color-mix(in srgb, var(--ap-success) 7%, var(--ap-bg)); }
#screen-result.r-denied { background: color-mix(in srgb, var(--ap-danger) 5%, var(--ap-bg)); }
#screen-result.r-offline { background: color-mix(in srgb, var(--ap-warning) 6%, var(--ap-bg)); }
.screen { scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }

/* Halo after a successful scan */
.gate-halo.ok { border-color: var(--ap-success); color: var(--ap-success); }

/* Simulated viewfinder (no real camera) */
.screen-scan { background: var(--dark); color: var(--ap-surface); }
.screen-scan .back-btn { top: 44px; }
.scan-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 96px 24px 24px; text-align: center; }
.scan-hint { margin: 0; font-size: 17px; font-weight: 500; }
.scan-status { margin: 0; min-height: 24px; font-size: 16px; color: color-mix(in srgb, var(--ap-surface) 75%, var(--dark)); }
.viewfinder {
  position: relative; width: 250px; height: 250px; border-radius: 28px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--ap-surface) 10%, transparent), transparent 70%);
  animation: vf-breathe 1.6s ease-in-out infinite;
}
@keyframes vf-breathe { 50% { transform: scale(.96); } }
.vf-c { position: absolute; width: 54px; height: 54px; border: 5px solid var(--ap-surface); transition: border-color .25s ease; }
.vf-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 24px 0 0 0; }
.vf-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 24px 0 0; }
.vf-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 24px; }
.vf-br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 24px 0; }
.vf-line {
  position: absolute; left: 18px; right: 18px; top: 18px; height: 3px; border-radius: 2px;
  background: var(--ap-accent); box-shadow: 0 0 14px var(--ap-accent);
  animation: vf-sweep 1.4s ease-in-out infinite alternate;
}
@keyframes vf-sweep { to { top: calc(100% - 21px); } }
.vf-ok { position: absolute; inset: 0; margin: auto; width: 90px; height: 90px; color: var(--ap-success); stroke-width: 2.4; opacity: 0; transform: scale(.6); transition: opacity .25s ease, transform .3s cubic-bezier(.2,1.4,.4,1); }
.viewfinder.found { animation: none; }
.viewfinder.found .vf-c { border-color: var(--ap-success); }
.viewfinder.found .vf-line { display: none; }
.viewfinder.found .vf-ok { opacity: 1; transform: none; }
.viewfinder.found + .scan-status { color: var(--ap-surface); font-weight: 600; }
.scan-cancel { color: var(--ap-surface); margin: 0 24px 32px; }
