/* Passkeys — login button, Security card, the "sign in faster" nudge and the
   confirm-it's-you dialog. Behaviour: static/js/passkeys.js. Uses the shared
   design tokens only, so light/dark follow the app theme. */

/* Component display rules (e.g. .sso-btn's flex) would beat the [hidden]
   attribute the script toggles. */
[data-passkey-login-wrap][hidden], [data-passkey-login][hidden],
[data-passkey-device-check][hidden], [data-passkey-error][hidden],
[data-passkey-unsupported][hidden], .pk-nudge[hidden] { display: none !important; }

/* ---- Login page / new-browser gate ------------------------------------- */
.pk-login { margin-bottom: 1rem; }
.pk-login .sso-btn { width: 100%; justify-content: center; }
.pk-login__icon { color: var(--brand); }
.pk-login__hint {
  margin: .5rem 0 0;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
}
.pk-error {
  margin: .75rem 0 0;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: .875rem;
}

/* ---- Security card ------------------------------------------------------- */
.pk-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.pk-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 1.2rem;
}
.pk-intro { display: flex; gap: .9rem; align-items: flex-start; }
.pk-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}
.pk-benefits li {
  padding: .8rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  font-size: .85rem;
  color: var(--text-muted);
}
.pk-benefits strong { display: block; color: var(--text); font-size: .9rem; margin-bottom: .15rem; }
.pk-benefits .bi { color: var(--brand); margin-right: .35rem; }
@media (max-width: 640px) { .pk-benefits { grid-template-columns: 1fr; } }

.pk-list { margin-top: 1rem; }
.pk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 0;
  border-top: 1px solid var(--border);
}
.pk-row__main { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.pk-row__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-row__meta { font-size: .8rem; color: var(--text-muted); }
.pk-row__actions { display: flex; gap: .4rem; flex: none; }
.pk-howto { margin: 1rem 0 0; font-size: .85rem; color: var(--text-muted); }

/* ---- Shell nudge card ------------------------------------------------------ */
.pk-nudge {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 1080;
  width: min(360px, calc(100vw - 32px));
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface, var(--bg-elev));
  box-shadow: var(--shadow, 0 12px 32px rgba(0, 0, 0, .18));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.pk-nudge.is-in { opacity: 1; transform: none; }
.pk-nudge__row { display: flex; gap: .8rem; align-items: flex-start; }
.pk-nudge__title { margin: 0 0 .2rem; font-size: .95rem; font-weight: 600; color: var(--text); }
.pk-nudge__text { margin: 0; font-size: .85rem; color: var(--text-muted); }
.pk-nudge__actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .85rem; }
@media (max-width: 480px) { .pk-nudge { right: 16px; bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .pk-nudge { transition: none; } }

/* ---- Confirm-it's-you dialog --------------------------------------------- */
.pk-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface, var(--bg-elev));
  color: var(--text);
}
.pk-dialog::backdrop { background: rgba(10, 14, 30, .45); }
.pk-dialog__body { padding: 1.4rem; text-align: center; }
.pk-dialog__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: .6rem;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 1.4rem;
}
.pk-dialog__title { margin: 0 0 .3rem; font-size: 1.15rem; }
.pk-dialog__lead { margin: 0 0 1rem; font-size: .9rem; color: var(--text-muted); }
.pk-dialog__error { margin-top: .5rem; font-size: .85rem; color: var(--danger); text-align: left; }
.pk-dialog__actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.1rem; }
