/* Sign-in control, account menu, save buttons and toast (assets/account.js). */

:root {
  --vdt-ink: #0b0b0b;
  --vdt-soft: rgba(0, 0, 0, 0.52);
  --vdt-fill: rgba(0, 0, 0, 0.063);
  --vdt-fill-strong: rgba(0, 0, 0, 0.1);
  --vdt-surface: #ffffff;
  --vdt-ring: 0 0 0 1px rgba(0, 0, 0, 0.06);
  --vdt-lift: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 10px 28px -8px rgba(0, 0, 0, 0.2);
  --vdt-ease: cubic-bezier(.22, 1, .36, 1);
}

.vdt-account { display: inline-flex; align-items: center; }

.vdt-account-inline { margin-left: 12px; }

.vdt-account-floating {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}

.vdt-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--vdt-surface);
  box-shadow: var(--vdt-ring), 0 1px 2px rgba(0, 0, 0, 0.06);
  color: var(--vdt-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms var(--vdt-ease);
}

.vdt-pill:hover,
.vdt-pill[aria-expanded="true"] { background: #f4f4f4; }
.vdt-pill:active { transform: scale(0.97); }

.vdt-account-button {
  display: inline-flex;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: var(--vdt-surface);
  box-shadow: var(--vdt-ring), 0 1px 2px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.vdt-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  overflow: hidden;
  border-radius: 999px;
  background: #e9e9e9;
  color: var(--vdt-soft);
  font-family: inherit;
  font-size: calc(var(--size) * 0.42);
  font-weight: 600;
  line-height: 1;
}

.vdt-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vdt-pill:focus-visible,
.vdt-account-button:focus-visible,
.vdt-save:focus-visible,
.vdt-menu-item:focus-visible {
  outline: 2px solid var(--vdt-ink);
  outline-offset: 2px;
}

/* ---------- Menu ---------- */

.vdt-menu {
  position: fixed;
  z-index: 60;
  width: 248px;
  padding: 6px;
  border-radius: 14px;
  background: var(--vdt-surface);
  box-shadow: var(--vdt-lift);
  color: var(--vdt-ink);
  font-size: 13px;
  line-height: 1.4;
  animation: vdt-menu-in 160ms var(--vdt-ease);
}

@keyframes vdt-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

.vdt-menu-title { margin: 8px 10px 8px; font-weight: 600; }

/* ---------- Sign-in panel ---------- */

.vdt-menu--sign-in { width: 272px; padding: 8px; }
.vdt-menu--sign-in .vdt-menu-title { margin: 8px 8px 2px; font-size: 14px; }
.vdt-menu-lead { margin: 0 8px 12px; color: var(--vdt-soft); }

.vdt-menu-item--provider {
  justify-content: center;
  height: 40px;
  margin-top: 6px;
  border-radius: 10px;
  box-shadow: var(--vdt-ring);
  font-weight: 500;
  transition: background-color 160ms ease, opacity 160ms ease, transform 120ms var(--vdt-ease);
}

.vdt-menu-item--provider:active { transform: scale(0.98); }
.vdt-menu-item:disabled { cursor: default; }
.vdt-menu-item:disabled:hover { background: transparent; }
.vdt-menu-item:disabled:not([data-busy]) { opacity: 0.4; }

/* The chosen provider while the page leaves for it: a spinner in place of its mark. */
.vdt-spinner {
  flex: none;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 1.8px solid var(--vdt-fill-strong);
  border-top-color: var(--vdt-ink);
  border-radius: 999px;
  animation: vdt-spin 700ms linear infinite;
}

@keyframes vdt-spin { to { rotate: 1turn; } }

.vdt-menu--sign-in .vdt-menu-note { margin: 12px 8px 4px; }
.vdt-menu-note { margin: 6px 10px 6px; color: var(--vdt-soft); font-size: 12px; }

.vdt-menu-user {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--vdt-fill);
}

.vdt-menu-user div { display: grid; min-width: 0; }
.vdt-menu-user strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.vdt-menu-user span { color: var(--vdt-soft); font-size: 12px; }

.vdt-menu-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.vdt-menu-item:hover { background: var(--vdt-fill); }
.vdt-menu-item svg { flex: none; width: 16px; height: 16px; }
.vdt-menu-item svg path:not([fill]) { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.vdt-menu-item em { margin-left: auto; color: var(--vdt-soft); font-style: normal; }

/* ---------- Save buttons ---------- */

.vdt-save {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 0;
  color: var(--vdt-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, opacity 160ms ease, transform 120ms var(--vdt-ease);
}

.vdt-save svg { width: 16px; height: 16px; }
.vdt-save svg path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transition: fill 160ms ease; }
.vdt-save[data-saved] svg path { fill: currentColor; }
.vdt-save:active { transform: scale(0.94); }

.vdt-card { position: relative; }

.vdt-save--card {
  position: absolute;
  top: 10px;
  right: 10px;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--vdt-ring), 0 2px 8px -2px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
}

.vdt-save--card .vdt-save-text { display: none; }

.vdt-card:hover .vdt-save--card,
.vdt-save--card:focus-visible,
.vdt-save--card[data-saved] { opacity: 1; }

@media (hover: none) {
  .vdt-save--card { opacity: 1; }
}

.vdt-save--inline {
  height: 32px;
  margin: -4px 0 24px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--vdt-fill);
}

.vdt-save--inline:hover { background: var(--vdt-fill-strong); }

/* ---------- Saved view ---------- */

.vdt-saved-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 24px;
  padding: 10px 10px 10px 16px;
  border-radius: 12px;
  background: var(--vdt-fill);
  font-size: 14px;
  font-weight: 600;
}

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

.vdt-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--vdt-ink);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 200ms ease, transform 200ms var(--vdt-ease);
  pointer-events: none;
}

.vdt-toast[data-show] { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .vdt-menu { animation: none; }
  .vdt-spinner { animation-duration: 2s; }
  .vdt-pill, .vdt-save, .vdt-toast { transition: none; }
}
