/**
 * auth-screen.css — the cinematic boot sign-in screen (scripts/ui/auth-screen.js),
 * the "Last used" chip, and the passkey ceremony overlay (passkey-ceremony.js).
 *
 * DEVICE-THEME-AWARE, SELF-SCOPED: every token lives on .pb-si-shell (or
 * .pb-pk-overlay) — never :root — with the cinematic DARK palette as the
 * default and a `prefers-color-scheme: light` override. The light-only builder
 * chrome never sees these variables. No manual toggle, no theme storage.
 *
 * Ported from the approved prototype builder/prototypes/auth-account-demo.html.
 * Selection colors reuse the builder's two-color system: --pb-accent-section
 * (violet) for sections, --pb-accent-element (blue) for elements (tokens.css).
 *
 * BREAKPOINTS: the hero split collapses at 900px — a hero-only threshold,
 * intentionally distinct from the canonical 640px phone breakpoint
 * (scripts/shared/breakpoints.js PHONE_MEDIA_QUERY); the ≤640px block only
 * tightens form-pane spacing.
 */

.pb-si-shell {
  /* ---- self-scoped tokens: dark defaults ---- */
  --si-bg: #0a0b0d;
  --si-surface: #131519;
  --si-text: #e7e9ee;
  --si-heading: #f6f7f9;
  --si-dim: #9aa1ad;
  --si-faint: #676e7a;
  --si-border: rgba(255, 255, 255, 0.09);
  --si-border-strong: rgba(255, 255, 255, 0.18);
  --si-field: rgba(255, 255, 255, 0.04);
  --si-field-focus: rgba(255, 255, 255, 0.07);
  --si-accent: #2f9bff;             /* --pb-accent lifted for the dark register */
  --si-accent-hover: #57b0ff;
  --si-on-accent: #051422;
  --si-accent-glow: rgba(47, 155, 255, 0.22);
  --si-glow: rgba(47, 155, 255, 0.09);
  --si-grain-op: 0.05;
  --si-error-fg: #fca5a5;
  --si-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --si-ease-snap: cubic-bezier(0.22, 1, 0.36, 1);
  --si-spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%,
    1.017 19.4%, 1.067 22.5%, 1.089 26%, 1.079 30.3%, 1.049 36%, 1.024 42.6%,
    1.011 50.3%, 1.004 59.2%, 1.001 69.3%, 1);

  position: fixed;
  inset: 0;
  z-index: var(--pb-z-modal);
  display: flex;
  overflow: hidden;
  isolation: isolate;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--si-bg);
  color: var(--si-text);
}

@media (prefers-color-scheme: light) {
  .pb-si-shell {
    --si-bg: #f0f1f3;               /* --pb-bg */
    --si-surface: #ffffff;
    --si-text: #374151;
    --si-heading: #111827;
    --si-dim: #6b7280;
    --si-faint: #9ca3af;
    --si-border: rgba(17, 24, 39, 0.1);
    --si-border-strong: rgba(17, 24, 39, 0.18);
    --si-field: rgba(17, 24, 39, 0.04);
    --si-field-focus: #ffffff;
    --si-accent: #0078d4;           /* --pb-accent verbatim */
    --si-accent-hover: #006cbd;
    --si-on-accent: #ffffff;
    --si-accent-glow: rgba(0, 120, 212, 0.2);
    --si-glow: rgba(0, 120, 212, 0.09);
    --si-grain-op: 0.03;
    --si-error-fg: #b91c1c;
  }
}

/* Film grain (felt, not seen) */
.pb-si-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: var(--si-grain-op);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.pb-si-brand {
  position: absolute;
  top: 26px;
  left: 30px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--si-heading);
}
.pb-si-brand img {
  border-radius: 7px;
  display: block;
}

/* ---- Left: form pane ---- */
.pb-si-form-pane {
  position: relative;
  flex: 1 1 46%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}
.pb-si-form-pane::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 30% 22%, var(--si-glow) 0%, transparent 60%);
}
.pb-si-form-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
}

.pb-si-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.4rem, 4.2vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.98;
  margin: 0 0 16px;
  color: var(--si-heading);
}
.pb-si-lede {
  color: var(--si-dim);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 30px;
  max-width: 38ch;
}

.pb-si-field { margin-bottom: 18px; }
.pb-si-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--si-dim);
  margin-bottom: 9px;
}
.pb-si-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--si-field);
  border: 1px solid var(--si-border);
  border-radius: 14px;
  transition: border-color 0.4s var(--si-ease-snap), background 0.4s var(--si-ease-snap),
              box-shadow 0.4s var(--si-ease-snap);
}
.pb-si-input-wrap:focus-within {
  background: var(--si-field-focus);
  border-color: var(--si-accent);
  box-shadow: 0 0 0 4px var(--si-accent-glow);
}
.pb-si-lead-icon {
  position: absolute;
  left: 15px;
  color: var(--si-faint);
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: color 0.4s var(--si-ease-snap);
}
.pb-si-input-wrap:focus-within .pb-si-lead-icon { color: var(--si-accent); }
.pb-si-input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 15px 15px 15px 44px;
  font-family: inherit;
  font-size: 15px;
  color: var(--si-heading);
  border-radius: 14px;
}
.pb-si-input-eye { padding-right: 46px; }
.pb-si-input::placeholder { color: var(--si-faint); }

/* builder.css interop: its global `input:not([type=color])…` rule is (0,4,1)
   and `input:focus-visible` paints a bright outline + glow. Match/beat that
   specificity inside the screen (this sheet also loads later). */
.pb-si-shell .pb-si-input-wrap > input.pb-si-input:not([type='hidden']) {
  padding: 15px 15px 15px 44px;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: var(--si-heading);
  font-size: 15px;
}
.pb-si-shell .pb-si-input-wrap > input.pb-si-input.pb-si-input-eye:not([type='hidden']) {
  padding-right: 46px;
}
.pb-si-shell .pb-si-input:focus-visible {
  outline: none;
  box-shadow: none; /* the wrap carries the focus ring */
}
.pb-si-shell button:focus-visible,
.pb-si-shell .pb-si-dot:focus-visible,
.pb-si-shell .pb-si-link:focus-visible {
  outline: 2px solid var(--si-accent);
  outline-offset: 2px;
  box-shadow: none;
}
.pb-pk-overlay button:focus-visible {
  outline: 2px solid var(--pk-accent);
  outline-offset: 2px;
  box-shadow: none;
}
.pb-si-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--si-faint);
  padding: 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: color 0.3s var(--si-ease-snap);
}
.pb-si-eye:hover { color: var(--si-heading); }
/* builder.css sets a display on svg that defeats the [hidden] attribute */
.pb-si-shell svg[hidden],
.pb-pk-overlay svg[hidden] { display: none; }

.pb-si-row {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 24px;
  font-size: 13px;
}
.pb-si-link {
  position: relative;
  color: var(--si-dim);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.3s var(--si-ease-snap);
}
.pb-si-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--si-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--si-ease-snap);
}
.pb-si-link:hover { color: var(--si-heading); }
.pb-si-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* Method wrapper hosts the Last-used chip: button text swaps can't delete it */
.pb-si-method { position: relative; }
.pb-si-method-passkey { margin-top: 12px; }

.pb-si-btn-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(180deg, var(--si-accent) 0%, var(--si-accent-hover) 100%);
  color: var(--si-on-accent);
  border: 0;
  border-radius: 14px;
  padding: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 22px var(--si-accent-glow);
  transition: transform 0.55s var(--si-spring), box-shadow 0.4s var(--si-ease-snap),
              filter 0.3s var(--si-ease-snap);
  will-change: transform;
}
.pb-si-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px var(--si-accent-glow);
  filter: brightness(1.05);
}
.pb-si-btn-primary:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }
.pb-si-btn-primary:disabled { opacity: 0.7; cursor: default; }
.pb-si-btn-primary svg { transition: transform 0.5s var(--si-ease-snap); }
.pb-si-btn-primary:hover:not(:disabled) svg { transform: translateX(3px); }

.pb-si-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--si-faint);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.pb-si-divider::before,
.pb-si-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--si-border);
}

.pb-si-btn-secondary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--si-field);
  color: var(--si-heading);
  border: 1px solid var(--si-border);
  border-radius: 14px;
  padding: 15px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.5s var(--si-spring), background 0.3s var(--si-ease-snap),
              border-color 0.3s var(--si-ease-snap);
}
.pb-si-btn-secondary:hover:not(:disabled) {
  background: var(--si-field-focus);
  border-color: var(--si-border-strong);
  transform: translateY(-1px);
}
.pb-si-btn-secondary:active { transform: scale(0.985); transition-duration: 0.1s; }
.pb-si-btn-secondary:disabled { opacity: 0.7; cursor: default; }

/* "Last used" chip — appended to the [data-login-method] WRAPPER by
   login-last-used.js. Fallback tokens keep it legible inside the light-chrome
   auth MODAL too (mid-session re-auth). */
.pb-last-used-badge {
  position: absolute;
  top: -9px;
  left: 16px;
  z-index: 2;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--si-accent, var(--pb-accent, #0078d4));
  background: var(--si-bg, var(--pb-surface, #fff));
  border: 1px solid var(--si-accent, var(--pb-accent, #0078d4));
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}
/* Inside the auth modal the wrapper is a plain row — give it an anchor. */
.pb-auth-form [data-login-method] { position: relative; }

.pb-si-alert {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.pb-si-alert-error {
  color: var(--si-error-fg);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.pb-si-alert-info {
  color: var(--si-accent);
  background: var(--si-accent-glow);
  border: 1px solid transparent;
}

.pb-si-admin-row {
  margin: 18px 0 0;
  text-align: center;
}
.pb-si-copyright {
  margin-top: 30px;
  text-align: center;
  font-size: 11px;
  color: var(--si-faint);
  letter-spacing: 0.03em;
}

/* ---- Right: the living canvas hero ---- */
.pb-si-hero {
  flex: 1 1 54%;
  position: relative;
  padding: 18px;
  display: none;
}
/* Hero-only breakpoint (NOT the canonical 640px phone breakpoint — see
   scripts/shared/breakpoints.js): the split needs more room than a phone. */
@media (min-width: 900px) {
  .pb-si-hero { display: block; }
}
.pb-si-hero-frame {
  position: absolute;
  inset: 18px;
  border-radius: 28px;
  overflow: hidden;
  background: #07080b;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: pb-si-slide-in 1s var(--si-ease-out) 0.15s both;
}
.pb-si-aurora {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(38% 44% at 28% 32%, rgba(47, 155, 255, 0.24) 0%, transparent 70%),
    radial-gradient(34% 40% at 74% 22%, rgba(167, 139, 250, 0.2) 0%, transparent 70%),
    radial-gradient(40% 46% at 62% 82%, rgba(56, 189, 248, 0.14) 0%, transparent 70%);
  animation: pb-si-aurora 26s ease-in-out infinite alternate;
  filter: blur(10px);
}
@keyframes pb-si-aurora {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(3%, -2%) rotate(4deg) scale(1.06); }
  100% { transform: translate(-3%, 2%) rotate(-3deg) scale(1.02); }
}
.pb-si-grid {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(90% 90% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(90% 90% at 50% 40%, #000 30%, transparent 100%);
}

.pb-si-page {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(430px, 72%);
  transform: translate(-50%, -50%) rotate(-1.2deg);
  animation: pb-si-bob 9s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@keyframes pb-si-bob {
  0%, 100% { transform: translate(-50%, -50%) rotate(-1.2deg); }
  50%      { transform: translate(-50%, -52.5%) rotate(-0.4deg); }
}
.pb-si-mock-section {
  position: relative;
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.pb-si-mock-nav { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.pb-si-mock-dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--pb-accent-element), var(--pb-accent-section));
  flex: none;
}
.pb-si-mock-line { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); }
.pb-si-mock-nav .pb-si-mock-line { width: 34px; }
.pb-si-mock-nav .pb-si-mock-line:last-child {
  margin-left: auto;
  width: 52px;
  height: 20px;
  border-radius: 7px;
  background: rgba(47, 155, 255, 0.5);
}
.pb-si-mock-hero .pb-si-title-line { width: 70%; height: 15px; background: rgba(255, 255, 255, 0.34); margin-bottom: 9px; }
.pb-si-mock-hero .pb-si-sub-line { width: 52%; margin-bottom: 14px; }
.pb-si-mock-cta-row { display: flex; gap: 8px; }
.pb-si-mock-cta {
  width: 74px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--si-accent), var(--si-accent-hover));
  box-shadow: 0 4px 14px var(--si-accent-glow);
}
.pb-si-mock-cta.pb-si-ghost { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.pb-si-mock-cards { display: flex; gap: 10px; }
.pb-si-mock-card {
  flex: 1;
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.pb-si-mock-thumb {
  height: 34px;
  border-radius: 7px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(47, 155, 255, 0.35), rgba(167, 139, 250, 0.35));
}
.pb-si-mock-card .pb-si-mock-line { width: 80%; margin-bottom: 6px; }
.pb-si-mock-card .pb-si-mock-line.pb-si-short { width: 55%; height: 5px; margin-bottom: 0; }
.pb-si-mock-footer { display: flex; gap: 10px; padding: 12px 16px; }
.pb-si-mock-footer .pb-si-mock-line { flex: 1; height: 6px; align-self: center; }

/* Selection choreography — the builder's violet/blue two-color system */
.pb-si-mock-section::before {
  content: attr(data-label);
  position: absolute;
  top: -9px;
  left: 12px;
  padding: 1px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--pb-accent-section);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: 0.3s var(--si-ease-snap);
}
.pb-si-mock-section.pb-si-sel-section {
  outline: 2px solid var(--pb-accent-section);
  outline-offset: 3px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 0 0 6px var(--pb-accent-section-subtle);
}
.pb-si-mock-section.pb-si-sel-section::before { opacity: 1; transform: none; }
.pb-si-el-sel {
  outline: 2px solid var(--pb-accent-element) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--pb-accent-element-subtle) !important;
}

.pb-si-cursor {
  position: absolute;
  z-index: 4;
  width: 18px;
  height: 18px;
  left: 0;
  top: 0;
  transition: transform 1.15s var(--si-ease-snap);
  will-change: transform;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.pb-si-cursor svg { width: 100%; height: 100%; display: block; }
.pb-si-cursor::after {
  content: attr(data-tag);
  position: absolute;
  left: 16px;
  top: 14px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--pb-accent-element);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
  transition: 0.25s var(--si-ease-snap);
}
.pb-si-cursor.pb-si-tagged::after { opacity: 1; transform: none; }
.pb-si-cursor.pb-si-tag-section::after { background: var(--pb-accent-section); }

.pb-si-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(4, 5, 8, 0.78) 0%, rgba(4, 5, 8, 0.05) 42%, rgba(4, 5, 8, 0.2) 100%);
}
.pb-si-caption {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 26px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.pb-si-caption-copy { max-width: 32ch; }
.pb-si-caption-copy h3 {
  margin: 0 0 4px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 19px;
  color: #fff;
  letter-spacing: -0.01em;
}
.pb-si-caption-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}
.pb-si-dots { display: flex; gap: 8px; }
.pb-si-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width 0.4s var(--si-spring), background 0.3s var(--si-ease-snap);
}
.pb-si-dot-active { width: 26px; border-radius: 5px; background: #fff; }

/* ---- Entry / exit motion ---- */
@keyframes pb-si-enter-up {
  from { opacity: 0; transform: translateY(22px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.pb-si-enter {
  opacity: 0;
  animation: pb-si-enter-up 0.8s var(--si-ease-out) both;
  animation-delay: var(--si-d, 0ms);
}
@keyframes pb-si-slide-in {
  from { opacity: 0; transform: translateX(40px); filter: blur(10px); }
  to   { opacity: 1; transform: translateX(0); filter: blur(0); }
}
.pb-si-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.12em;
}
.pb-si-word {
  display: inline-block;
  transform: translateY(110%);
  animation: pb-si-word-rise 0.95s var(--si-spring) both;
  animation-delay: var(--si-wd, 0ms);
}
@keyframes pb-si-word-rise { to { transform: translateY(0); } }

@keyframes pb-si-leave-out {
  to { opacity: 0; transform: scale(1.02); filter: blur(8px); }
}
.pb-si-shell.pb-si-leave {
  animation: pb-si-leave-out 0.45s var(--si-ease-snap) both;
  pointer-events: none;
}

/* ---- ≤640px: canonical phone breakpoint — tighten the form stack ---- */
@media (max-width: 640px) {
  .pb-si-brand { top: 20px; left: 22px; }
  .pb-si-form-pane {
    align-items: flex-start;
    padding: 78px 22px 28px;
    -webkit-overflow-scrolling: touch;
  }
  .pb-si-title { font-size: clamp(2rem, 10vw, 2.8rem); margin-bottom: 8px; }
  .pb-si-lede { margin-bottom: 16px; }
  .pb-si-field { margin-bottom: 12px; }
  .pb-si-row { margin: 4px 0 14px; }
  .pb-si-divider { margin: 14px 0; }
  .pb-si-copyright { margin-top: 16px; }
}

/* ═══════════════ Passkey ceremony overlay (.pb-pk-*) ═════════════════════
   Device-theme-aware with its own token scope: it floats above BOTH the dark
   sign-in screen and the light builder (settings "Add a passkey"). */
.pb-pk-overlay {
  --pk-surface: #131519;
  --pk-border: rgba(255, 255, 255, 0.09);
  --pk-heading: #f6f7f9;
  --pk-dim: #9aa1ad;
  --pk-accent: #2f9bff;
  --pk-accent-glow: rgba(47, 155, 255, 0.22);
  --pk-accent-muted: rgba(47, 155, 255, 0.1);
  --pk-hover: rgba(255, 255, 255, 0.07);
  --pk-success: #34c98e;
  --pk-success-muted: rgba(52, 201, 142, 0.15);

  position: fixed;
  inset: 0;
  z-index: var(--pb-z-toast);
  display: grid;
  place-items: center;
  background: rgba(4, 6, 10, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: light) {
  .pb-pk-overlay {
    --pk-surface: #ffffff;
    --pk-border: rgba(17, 24, 39, 0.1);
    --pk-heading: #111827;
    --pk-dim: #6b7280;
    --pk-accent: #0078d4;
    --pk-accent-glow: rgba(0, 120, 212, 0.2);
    --pk-accent-muted: rgba(0, 120, 212, 0.08);
    --pk-hover: rgba(17, 24, 39, 0.06);
    --pk-success: #16a34a;
    --pk-success-muted: rgba(22, 163, 74, 0.12);
    background: rgba(15, 23, 42, 0.4);
  }
}
.pb-pk-overlay.pb-pk-open { opacity: 1; }
.pb-pk-card {
  width: 300px;
  padding: 34px 28px 26px;
  text-align: center;
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pb-pk-open .pb-pk-card { transform: none; }
.pb-pk-orb { position: relative; width: 84px; height: 84px; margin: 0 auto 18px; }
.pb-pk-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--pk-accent-glow);
  opacity: 0;
}
.pb-pk-open .pb-pk-orb-ring { animation: pb-pk-pulse 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.pb-pk-orb-ring:nth-child(2) { animation-delay: 0.45s !important; }
@keyframes pb-pk-pulse {
  0%   { transform: scale(0.75); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
.pb-pk-orb-core {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pk-accent-muted);
  color: var(--pk-accent);
  transition: background 0.3s, color 0.3s;
}
.pb-pk-success .pb-pk-orb-core { background: var(--pk-success-muted); color: var(--pk-success); }
.pb-pk-success .pb-pk-orb-ring { animation: none; opacity: 0; }
.pb-pk-check { stroke-dasharray: 26; stroke-dashoffset: 26; }
.pb-pk-success .pb-pk-check { animation: pb-pk-draw 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards; }
@keyframes pb-pk-draw { to { stroke-dashoffset: 0; } }
.pb-pk-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  color: var(--pk-heading);
}
.pb-pk-sub {
  margin: 0 0 20px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--pk-dim);
}
.pb-pk-cancel {
  background: none;
  border: 0;
  color: var(--pk-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
}
.pb-pk-cancel:hover { color: var(--pk-heading); background: var(--pk-hover); }

/* ---- Reduced motion: scoped to these surfaces ONLY (never global) ---- */
@media (prefers-reduced-motion: reduce) {
  .pb-si-shell .pb-si-enter,
  .pb-si-shell .pb-si-hero-frame {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .pb-si-shell .pb-si-word { animation: none; transform: none; }
  .pb-si-shell .pb-si-aurora,
  .pb-si-shell .pb-si-page { animation: none; }
  .pb-si-shell.pb-si-leave { animation: none; opacity: 0; }
  .pb-si-shell .pb-si-cursor,
  .pb-si-shell .pb-si-dot,
  .pb-si-shell .pb-si-btn-primary,
  .pb-si-shell .pb-si-btn-secondary,
  .pb-si-shell .pb-si-link::after,
  .pb-si-shell .pb-si-input-wrap { transition-duration: 0.01ms; }
  .pb-pk-overlay,
  .pb-pk-card { transition-duration: 0.01ms; }
  .pb-pk-open .pb-pk-orb-ring { animation: none; opacity: 0.5; }
  .pb-pk-success .pb-pk-check { animation-duration: 0.01ms; }
}

/* Forced colors: keep the chip + alerts legible with system colors. */
@media (forced-colors: active) {
  .pb-last-used-badge {
    color: Highlight;
    background: Canvas;
    border-color: Highlight;
  }
}
