:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --accent: #2563eb;
  --border: #e5e7eb;
  --error: #dc2626;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #e6e7ea;
    --muted: #9aa0aa;
    --accent: #3b82f6;
    --border: #2a2e37;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* The rendered page fills the viewport once it loads. */
#frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

/* Status and password live centered until the page renders. */
#app {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.status, .panel {
  max-width: 28rem;
  text-align: center;
}
.status h1, .panel h1 { font-size: 1.25rem; margin: 0 0 .5rem; }
.status p, .panel p { color: var(--muted); margin: .25rem 0; }

.spinner {
  width: 28px; height: 28px;
  margin: 0 auto 12px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.panel {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.panel input {
  padding: .6rem .75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
}
.panel button {
  padding: .6rem .75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.panel button:hover { filter: brightness(1.05); }
.error { color: var(--error); font-size: .9rem; }
