:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --text: #e8eaf0;
  --muted: #8b90a0;
  --accent: #4f7cff;
  --danger: #ff5c5c;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Login */
.card {
  max-width: 380px;
  margin: 18vh auto;
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
}
.card h1 { margin-bottom: .5rem; }
.card p { color: var(--muted); margin-bottom: 1.25rem; }
input {
  width: 100%;
  padding: .75rem 1rem;
  margin-bottom: .75rem;
  border-radius: 8px;
  border: 1px solid #33384a;
  background: #12141c;
  color: var(--text);
  font-size: 1rem;
}
button {
  padding: .7rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: #2a2e3f;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
button.primary { background: var(--accent); }
button:hover { filter: brightness(1.15); }
.error { color: var(--danger); min-height: 1.2em; margin-top: .5rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .5rem 0; }
.hidden { display: none !important; }

/* Vault */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #23273a;
}
header h1 { font-size: 1.3rem; }
header div { display: flex; gap: .5rem; }

main { max-width: 560px; margin: 1rem auto; padding: 0 1rem; }
#empty { text-align: center; color: var(--muted); margin-top: 3rem; }

#list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.entry-info { flex: 1; min-width: 0; }
.entry-issuer { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.entry-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 1.6rem;
  letter-spacing: .12em;
  user-select: all;
  cursor: pointer;
}
.entry-actions { display: flex; flex-direction: column; gap: .35rem; align-items: center; position: relative; }
.countdown {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .75rem; color: var(--muted);
}
.ring { position: absolute; top: 0; left: 50%; transform: translateX(-50%) rotate(-90deg); width: 34px; height: 34px; }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: #2a2e3f; }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.icon-btn { background: none; padding: .25rem; font-size: 1rem; opacity: .6; }
.icon-btn:hover { opacity: 1; filter: none; }

/* Modals */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: grid; place-items: center;
  z-index: 10;
}
.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(92vw, 420px);
}
.modal-card h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tab { flex: 1; background: #2a2e3f; }
.tab.active { background: var(--accent); }

#video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  aspect-ratio: 1;
  object-fit: cover;
}

#qrImg { width: 100%; image-rendering: pixelated; border-radius: 8px; background: #fff; padding: .5rem; }

@media (max-width: 480px) {
  header h1 { font-size: 1.1rem; }
  .entry-code { font-size: 1.35rem; }
}
