/* ── Tokens ──────────────────────────────────── */
:root {
  --void:     #080808;
  --obsidian: #111113;
  --seam:     #1e1e22;
  --hairline: rgba(255,255,255,.06);
  --smoke:    #5a5a65;
  --ash:      #9696a0;
  --cream:    #e8e6df;
  --arc:      #c8ff57;
  --arc-dim:  rgba(200,255,87,.15);
  --arc-glow: rgba(200,255,87,.35);
  --warn:     #ff6b35;
  --warn-dim: rgba(255,107,53,.15);
  --font: 'Syne', sans-serif;
  --mono: 'DM Mono', monospace;
}

html[data-theme="light"] {
  --void:     #f0ede8;
  --obsidian: #e8e5e0;
  --seam:     #dedad4;
  --hairline: rgba(0,0,0,.08);
  --smoke:    #7a7a70;
  --ash:      #888880;
  --cream:    #1a1a1a;
  --arc:      #1a7a40;
  --arc-dim:  rgba(26,122,64,.15);
  --arc-glow: rgba(26,122,64,.30);
  --warn:     #c04a10;
  --warn-dim: rgba(192,74,16,.15);
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

/* ── Body ────────────────────────────────────── */
html { background: var(--void); }

body {
  font-family: var(--font);
  color: var(--cream);
  background: var(--void);
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
}

/* Noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
}

/* Radial vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(200,255,87,.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] body::after {
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(26,122,64,.03) 0%, transparent 70%);
}

/* ── Page ────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

/* ── Topbar ──────────────────────────────────── */
.topbar {
  width: 100%;
  padding: 0 20px;
}

.topbar-inner {
  max-width: 400px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--arc);
  flex-shrink: 0;
  animation: brandPulse 2.2s ease-in-out infinite;
}

@keyframes brandPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.82); }
}

.brand-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--cream);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-weight: 400;
  font-size: 16px;
  color: var(--smoke);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--seam);
  color: var(--ash);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  line-height: 1;
}

.theme-btn:hover {
  background: var(--obsidian);
  color: var(--cream);
  border-color: var(--arc);
}

/* ── Container ───────────────────────────────── */
.container {
  width: 100%;
  max-width: 400px;
  padding: 16px 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ── Clock ───────────────────────────────────── */
.clock-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  cursor: pointer;
  animation: clockIn 0.4s cubic-bezier(.16,1,.3,1) both;
  flex-shrink: 0;
}

@keyframes clockIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.clock-svg { display: block; }

.clock-bg { fill: #16161a; }
html[data-theme="light"] .clock-bg { fill: #dedad4; }

.clock-track { stroke: var(--seam); }

.clock-arc {
  stroke: var(--arc);
  stroke-dasharray: 640.885;
  stroke-dashoffset: 0;
  transition: stroke 0.6s ease, filter 0.6s ease;
  filter: drop-shadow(0 0 10px var(--arc-glow));
}

.clock-arc.expiring {
  stroke: var(--warn);
  filter: drop-shadow(0 0 14px rgba(255,107,53,.55));
}

/* Clock inner overlay */
.clock-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}

.clock-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--smoke);
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.clock-digits {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 400;
  color: var(--arc);
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.6s ease;
}

.clock-digits.expiring {
  color: var(--warn);
  animation: digitPulse 0.5s ease-in-out infinite alternate;
}

.clock-digits.refreshed {
  animation: digitIn 0.2s cubic-bezier(.16,1,.3,1) both;
}

.clock-digits.copy-flash {
  color: var(--void) !important;
  background: var(--arc);
  border-radius: 4px;
  padding: 3px 8px;
  animation: none !important;
  transition: none;
}

@keyframes digitIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes digitPulse {
  from { opacity: 1; }
  to   { opacity: 0.65; }
}

.clock-secs {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ash);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

/* ── Input area ──────────────────────────────── */
.input-area {
  width: 100%;
  animation: areaIn 0.4s cubic-bezier(.16,1,.3,1) 0.06s both;
}

@keyframes areaIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.status-msg {
  font-size: 12px;
  color: var(--warn);
  min-height: 18px;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.secret-wrap { position: relative; }

.secret-input {
  width: 100%;
  height: 44px;
  background: var(--seam);
  border: 1px solid var(--hairline);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0 44px 0 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.secret-input::placeholder { color: var(--smoke); opacity: 1; }

.secret-input:focus {
  border-color: var(--arc);
  box-shadow: 0 0 0 3px var(--arc-dim);
}

.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--smoke);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.eye-btn:hover { color: var(--ash); }

.gen-btn {
  width: 100%;
  height: 48px;
  background: var(--arc);
  border: none;
  border-radius: 0 0 6px 6px;
  color: var(--void);
  font-family: var(--font);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.15em;
  transition: filter 0.15s, transform 0.15s;
}

.gen-btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.gen-btn:active { transform: translateY(0); }

/* ── Accounts ────────────────────────────────── */
.accounts-section {
  width: 100%;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
  animation: areaIn 0.4s cubic-bezier(.16,1,.3,1) 0.1s both;
}

.accounts-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.sec-lbl, .sec-dot, .sec-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--smoke);
  letter-spacing: 0.2em;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 20px 0;
  color: var(--smoke);
  text-align: center;
}

.empty-state p {
  font-size: 13px;
  color: var(--ash);
  margin-top: 4px;
}

.empty-state span {
  font-size: 11px;
  color: var(--smoke);
}

/* Account row */
.acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.acc-row:hover { background: var(--seam); }

.acc-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--smoke);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.acc-row.is-active .acc-indicator {
  background: var(--arc);
  border-color: var(--arc);
}

.acc-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--cream);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-load {
  font-size: 12px;
  color: var(--smoke);
  white-space: nowrap;
  transition: color 0.15s;
  flex-shrink: 0;
}

.acc-row:hover .acc-load { color: var(--arc); }

.acc-del {
  background: none;
  border: none;
  color: var(--smoke);
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.acc-row:hover .acc-del { opacity: 1; }
.acc-del:hover { color: var(--warn); }

/* Save row */
.save-div {
  height: 1px;
  background: var(--hairline);
  margin: 12px 0;
}

.save-inputs {
  display: flex;
  gap: 8px;
}

.label-input {
  flex: 1;
  height: 36px;
  background: var(--seam);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--cream);
  font-size: 13px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.label-input:focus {
  border-color: var(--arc);
  box-shadow: 0 0 0 2px var(--arc-dim);
}

.label-input::placeholder { color: var(--smoke); }

.save-btn {
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--arc);
  border-radius: 4px;
  color: var(--arc);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.save-btn:hover { background: var(--arc-dim); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 440px) {
  .container { padding-left: 16px; padding-right: 16px; }
}
