/* ==================================================================
   Vaultly — shared design system
   Tailwind (CDN) handles layout/spacing utilities.
   This file owns the things Tailwind can't: the aurora background,
   glass surfaces, the custom scrollbar, and all keyframe animation.
   ================================================================== */

:root {
  --bg: #07070c;
  --bg-soft: #0d0d16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f2f8;
  --text-dim: #9498ad;
  --text-faint: #61657c;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Aurora background -------------------------------------- */
/* Three slow-drifting blurred blobs. Fixed, behind everything, no pointer events. */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.aurora::after {
  /* fine noise texture so the gradients don't band on cheap displays */
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.blob-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  top: -140px; left: -100px;
  animation: drift-1 22s ease-in-out infinite;
}

.blob-2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: -160px; right: -80px;
  animation: drift-2 27s ease-in-out infinite;
}

.blob-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  top: 45%; left: 55%;
  opacity: 0.3;
  animation: drift-3 32s ease-in-out infinite;
}

@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(90px, 70px) scale(1.12); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-80px, -60px) scale(1.08); }
}
@keyframes drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-110px, 50px) scale(0.9); }
}

/* ---------- Glass surfaces ----------------------------------------- */

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-radius: var(--radius);
}

.glass-strong {
  background: rgba(13, 13, 22, 0.82);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-radius: var(--radius);
}

/* ---------- Gradient text + brand ---------------------------------- */

.grad-text {
  background: linear-gradient(115deg, #c4b5fd 0%, #a78bfa 30%, #67e8f9 70%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 6px 24px -6px rgba(139, 92, 246, 0.75);
}

/* ---------- Profile cards (first page) ------------------------------ */

.profile-card {
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.28s;
  border: 1px solid transparent;
  border-radius: 22px;
  padding: 22px 14px;
}

.profile-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  background: var(--surface);
}

.profile-card:hover .profile-avatar {
  transform: scale(1.06);
  box-shadow: 0 14px 40px -10px rgba(139, 92, 246, 0.6);
}

.profile-avatar {
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.28s;
  position: relative;
}

/* thin animated ring that only shows on hover */
.profile-card:hover .profile-avatar::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  z-index: -1;
  animation: spin 3.5s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Vault cards --------------------------------------------- */

.vault-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.vault-card::before {
  /* accent hairline down the left edge, revealed on hover */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.vault-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.9);
}

.vault-card:hover::before { transform: scaleY(1); }

/* ---------- Inputs --------------------------------------------------- */

.field {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field::placeholder { color: var(--text-faint); }

.field:focus {
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

textarea.field { resize: vertical; min-height: 84px; line-height: 1.55; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}

/* ---------- Buttons -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 55%, var(--accent-2) 140%);
  color: #fff;
  box-shadow: 0 8px 24px -10px rgba(139, 92, 246, 0.9);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.13); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); }

.btn-danger {
  background: rgba(251, 113, 133, 0.14);
  color: var(--danger);
  border: 1px solid rgba(251, 113, 133, 0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(251, 113, 133, 0.24); }

/* small square icon button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn.copied {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--ok);
}

/* ---------- Chips / badges -------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.chip-active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
}

.chip-new {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.36);
  color: var(--ok);
}

/* ---------- Modal ------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 9, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  animation: fade-in 0.2s ease;
}

.modal-panel {
  width: 100%;
  max-width: 620px;
  animation: pop-in 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Toast ------------------------------------------------------ */

#toast-host {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(18, 18, 30, 0.94);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.95);
  animation: toast-in 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.toast.ok    { border-color: rgba(52, 211, 153, 0.4);  color: var(--ok); }
.toast.error { border-color: rgba(251, 113, 133, 0.4); color: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Entrance animation for lists ------------------------------- */

.stagger-in {
  animation: rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

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

/* ---------- Password reveal -------------------------------------------- */

.secret {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.secret.masked {
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

/* ---------- Strength meter ---------------------------------------------- */

.strength-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.35s ease;
}

/* ---------- Timeline ----------------------------------------------------- */

.timeline-item {
  position: relative;
  padding-left: 26px;
  padding-bottom: 18px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 8.5px; top: 18px; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::after { display: none; }

/* ---------- Scrollbar ---------------------------------------------------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: content-box; }

/* ---------- Misc ---------------------------------------------------------- */

.hide { display: none !important; }

mark {
  background: rgba(139, 92, 246, 0.32);
  color: #ddd6fe;
  border-radius: 3px;
  padding: 0 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- User guide --------------------------------------------------- */

/* Inline keycap, used in the guide's shortcut hints */
.guide-kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
}

/* Subtle "new here?" prompt on the login page and the empty vault */
.hint-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.18s ease;
}

.hint-link:hover { color: var(--accent-2); }
