:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --text: #e8e9ec;
  --muted: #9aa0ab;
  --accent: #5b8def;
  --accent-hover: #4576d6;
  --danger: #e35d6a;
  --success: #3fb27f;
  --border: #2a2e38;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.brand { font-weight: 600; font-size: 1.1rem; }

.topbar-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

h1, h2 { font-weight: 600; }
h1 { font-size: 1.4rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0 4px;
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #11141a;
  color: var(--text);
  font-size: 1rem;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 60px; }

button, .btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .btn:hover { background: var(--accent-hover); }

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.danger { background: var(--danger); }

.btn-block { width: 100%; margin-top: 12px; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.search-wrap { margin-bottom: 16px; }

.entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card);
}

.entry-name { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }

.entry-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 4px 0;
  border-top: 1px solid var(--border);
}

.entry-field:first-of-type { border-top: none; }

.entry-field .value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  text-align: right;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  padding: 2px 6px;
  cursor: pointer;
}

.entry-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.entry-actions button {
  flex: 1;
  font-size: 0.85rem;
  padding: 8px;
}

.flash {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.flash-error { background: rgba(227, 93, 106, 0.15); color: var(--danger); border: 1px solid var(--danger); }
.flash-success { background: rgba(63, 178, 127, 0.15); color: var(--success); border: 1px solid var(--success); }

.muted { color: var(--muted); font-size: 0.85rem; }

.recovery-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.3rem;
  text-align: center;
  letter-spacing: 1px;
  padding: 16px;
  background: #11141a;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  margin: 16px 0;
}

.center { text-align: center; }
.links { text-align: center; margin-top: 16px; font-size: 0.9rem; }
.links a { color: var(--accent); }

.empty-state { text-align: center; color: var(--muted); padding: 32px 0; }

.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 540px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 16px; }
}

.use-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(91, 141, 239, 0.15);
  color: var(--accent);
  vertical-align: middle;
}

/* Binary rain achtergrond */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Zorg dat kaarten en topbar iets meer opacity krijgen zodat ze
   goed leesbaar blijven boven de animatie */
.topbar {
  background: rgba(15, 17, 21, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card, .entry, .modal {
  background: rgba(26, 29, 36, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
