/*
 * One stylesheet for the unlock page, the viewer and the error page.
 * No web fonts and no external resources: the CSP is default-src 'self'
 * (NFR-SEC-04, NFR-SEC-15).
 */

:root {
  --bg: #0f1115;
  --surface: #171a21;
  --border: #262b36;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --danger: #ff6b6b;
  --focus: #ffcc00;
  --radius: 10px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #d8dce3;
    --text: #14171c;
    --muted: #5b6472;
    --accent: #1a56db;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ----------------------------------------------------------- unlock / error */

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.input {
  width: 100%;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;   /* 16px stops iOS Safari zooming on focus */
  letter-spacing: 0.08em;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.input:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hint {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.button:hover { filter: brightness(1.08); }

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.button-compact {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

.error {
  margin: 18px 0 0;
  padding: 12px 14px;
  color: var(--danger);
  font-size: 14px;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
}

/* ------------------------------------------------------------------ viewer */

.viewer-body {
  display: block;
  padding: 0;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.viewer-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-meta {
  color: var(--muted);
  font-size: 12px;
  margin-right: auto;
  white-space: nowrap;
}

.viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 57px);
  padding: 16px;
}

.viewer-status {
  color: var(--muted);
  font-size: 14px;
}

.viewer-status.error { color: var(--danger); }

.media {
  max-width: 100%;
  max-height: calc(100vh - 90px);
  border-radius: 8px;
}

.media.frame {
  width: 100%;
  height: calc(100vh - 90px);
  border: 0;
  background: var(--surface);
}

.media.audio { width: min(520px, 100%); }

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