:root {
  --bg: #0f1220;
  --bg2: #171a2e;
  --card: #1d2138;
  --line: #2a2f4d;
  --ink: #eef1ff;
  --muted: #97a0c3;
  --accent: #6c7bff;
  --accent2: #4ade80;
  --danger: #f87171;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 50% -10%, #232a52 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.brand-icon { font-size: 40px; filter: drop-shadow(0 4px 12px rgba(108,123,255,.4)); }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: 0.02em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.card {
  background: rgba(29,33,56,.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
}
.card h2 { margin: 0 0 6px; font-size: 19px; }
.card h3 { margin: 22px 0 4px; font-size: 15px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }

.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,123,255,.18); }

.btn {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: transform .12s, filter .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; width: 100%; margin-top: 6px; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); width: auto; margin: 0; }
.btn.ghost:hover { color: var(--ink); border-color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(248,113,113,.4); width: auto; margin-top: 8px; }
.btn.danger:hover { background: rgba(248,113,113,.1); }

.error { color: var(--danger); font-size: 13px; margin: 8px 0 0; }
.hidden { display: none !important; }

.chip {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.accounts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.account {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.account:hover { border-color: var(--accent); transform: translateY(-1px); }
.account-avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  background: linear-gradient(135deg, #2a3266, #4a4f7d);
  color: #fff;
  letter-spacing: .05em;
}
.account-label { font-size: 14px; font-weight: 600; }
.account-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.account-code { text-align: right; }
.account-code .digits { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; letter-spacing: .08em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.account-code .expires { margin-top: 4px; }
.ring { display: inline-block; width: 22px; height: 22px; border-radius: 50%; opacity: .9; }
.ring.low { opacity: .35; }

.add-form { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.add-form .btn.primary { width: auto; }

.danger { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--danger); font-size: 13px; }
.danger summary { cursor: pointer; font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #0f1220;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  z-index: 10;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 480px) {
  .app { padding: 24px 14px 60px; }
  .account { grid-template-columns: auto 1fr; }
  .account-code { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; gap: 10px; }
}