/* iPhone-style lock screen for passcode entry. Phones only: every rule that
   draws anything is scoped under .pc-mobile, which passcode.js adds to <html>
   only on a phone. On a desktop none of this applies. */

.pc-inline,
.pc-overlay { display: none; }

/* ── The real field: still holds the value, just not drawn ─────────────────── */
.pc-mobile .pc-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.pc-mobile .pc-label { text-align: center; }
.pc-mobile .pc-hide-on-mobile { display: none; }

/* ── On the page: dots you tap to open the keypad ──────────────────────────── */
.pc-mobile button.pc-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 6px 0 4px;
  padding: 18px 0 14px;
  font: inherit;
  color: var(--ink-soft, #6e6e73);
  background: var(--bg-sunken, #f5f5f7);
  border: 1px solid var(--line, #e8e8ed);
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .12s ease, border-color .15s ease;
}
.pc-mobile button.pc-inline:hover,
.pc-mobile button.pc-inline:focus {
  background: var(--bg-sunken, #f5f5f7);
  color: var(--ink-soft, #6e6e73);
  outline: none;
}
.pc-mobile button.pc-inline:active { transform: scale(.98); border-color: #5b45d6; }
.pc-mobile button.pc-inline.bad { border-color: #f5c7c3; background: #fdeceb; }
.pc-mobile button.pc-inline.bad .pc-inline-hint { color: #b3261e; font-weight: 600; }
.pc-mobile .pc-inline .pc-dots { display: flex; gap: 16px; }
.pc-mobile .pc-inline .pc-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid #a1a1a6;
  transition: background-color .12s ease, border-color .12s ease;
}
.pc-mobile .pc-inline .pc-dots span.on { background: #1c1c1e; border-color: #1c1c1e; }
.pc-inline-hint { font-size: 12px; letter-spacing: .02em; padding: 0 12px; text-align: center; }

/* ── The lock screen ───────────────────────────────────────────────────────── */
.pc-mobile .pc-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  /* Frosted glass over the page, tinted like a lock-screen wallpaper. */
  background:
    radial-gradient(110% 70% at 15% 0%,  rgba(124, 92, 255, .70) 0%, transparent 60%),
    radial-gradient(100% 70% at 100% 100%, rgba(236, 92, 160, .55) 0%, transparent 60%),
    rgba(14, 12, 28, .78);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  opacity: 0;
  transition: opacity .24s ease;
}
.pc-mobile .pc-overlay[hidden] { display: none !important; }
.pc-mobile .pc-overlay.show { opacity: 1; }

.pc-sheet {
  width: 100%;
  max-width: 420px;
  padding:
    max(36px, env(safe-area-inset-top)) 24px
    max(30px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  transform: translateY(28px) scale(.98);
  transition: transform .36s cubic-bezier(.2, .9, .25, 1);
}
.pc-overlay.show .pc-sheet { transform: none; }

.pc-goose {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35));
}

.pc-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .01em;
  margin-bottom: 24px;
  min-height: 1.3em;
  text-align: center;
  transition: color .2s ease;
}
.pc-title.pc-title-bad { color: #ffb4c7; }

.pc-dots-big { display: flex; gap: 22px; margin-bottom: 48px; }
.pc-dots-big span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.6px solid rgba(255, 255, 255, .92);
  transition: background-color .1s ease, transform .14s ease;
}
.pc-dots-big span.on { background: #fff; transform: scale(1.1); }

/* ── Keypad ──────────────────────────────────────────────────────────────────
   The pages this lands on style bare `button` elements (purple fill, full
   width, padding, a top margin, a purple :hover). Phones leave :hover stuck on
   the last thing tapped, which is what kept a key purple until the next press.
   So the key rules below are written as `.pc-mobile .pc-overlay button.x`,
   which outranks `button:hover:not(:disabled)`, and set everything a page
   might touch. */
.pc-mobile .pc-overlay button {
  margin: 0;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.pc-pad {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  gap: 18px 26px;
  justify-content: center;
}

.pc-mobile .pc-overlay button.pc-key,
.pc-mobile .pc-overlay button.pc-key:hover,
.pc-mobile .pc-overlay button.pc-key:focus,
.pc-mobile .pc-overlay button.pc-key:active {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, .17);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  /* Fades back slowly after release, the way the real keypad does. */
  transition: background-color .35s ease, transform .15s ease;
}
.pc-mobile .pc-overlay button.pc-key.down {
  background: rgba(255, 255, 255, .62);
  transform: scale(.94);
  transition: background-color 0s, transform .06s ease;
}

.pc-num { font-size: 36px; font-weight: 300; line-height: 1; }
.pc-abc {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .22em;
  padding-left: .22em;        /* letter-spacing adds a trailing gap; balance it */
  line-height: 1;
  margin-top: 3px;
  opacity: .92;
}

.pc-mobile .pc-overlay button.pc-text,
.pc-mobile .pc-overlay button.pc-text:hover,
.pc-mobile .pc-overlay button.pc-text:focus,
.pc-mobile .pc-overlay button.pc-text:active {
  /* Exactly a key's size, so the word sits where the circle would be. */
  width: 80px;
  height: 80px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: #fff;
  font: 400 17px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity .15s ease;
}
.pc-mobile .pc-overlay button.pc-text.down { opacity: .45; }

/* ── Wrong passcode ────────────────────────────────────────────────────────── */
.pc-dots-big.shake { animation: pc-shake .48s cubic-bezier(.36, .07, .19, .97); }
@keyframes pc-shake {
  10%, 90% { transform: translateX(-3px); }
  20%, 80% { transform: translateX(6px); }
  30%, 50%, 70% { transform: translateX(-11px); }
  40%, 60% { transform: translateX(11px); }
}

/* Nothing scrolls behind the lock screen. */
html.pc-locked,
html.pc-locked body { overflow: hidden; }

/* Smaller phones and landscape: shrink the keys rather than overflow. */
@media (max-height: 680px) {
  .pc-pad { grid-template-columns: repeat(3, 68px); gap: 12px 22px; }
  .pc-mobile .pc-overlay button.pc-key,
  .pc-mobile .pc-overlay button.pc-key:hover,
  .pc-mobile .pc-overlay button.pc-key:focus,
  .pc-mobile .pc-overlay button.pc-key:active,
  .pc-mobile .pc-overlay button.pc-text,
  .pc-mobile .pc-overlay button.pc-text:hover,
  .pc-mobile .pc-overlay button.pc-text:focus,
  .pc-mobile .pc-overlay button.pc-text:active { width: 68px; height: 68px; }
  .pc-num { font-size: 30px; }
  .pc-dots-big { margin-bottom: 28px; }
  .pc-goose { font-size: 32px; margin-bottom: 8px; }
  .pc-title { margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-overlay, .pc-sheet, .pc-dots-big span,
  .pc-mobile .pc-overlay button.pc-key { transition: none; }
  .pc-dots-big.shake { animation: none; }
}
