/* PIN Screen & Loading Screen */
.pin-screen {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--bg), var(--bg2));
}

.pin-screen.unlocked {
  display: none !important;
}

.pin-card {
  width: min(100%, 380px);
  padding: 28px 24px;
  border-radius: 32px;
  text-align: center;
}

.pin-logo {
  font-size: 38px;
  color: var(--pink);
  margin-bottom: 8px;
}

.pin-copy h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 950;
}

.pin-copy p {
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.pin-code-wrap {
  position: relative;
  width: min(100%, 230px);
  margin: 0 auto;
}

.pin-code-boxes {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.pin-code-box {
  width: 44px;
  height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--solid);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  transition: 0.18s ease;
}

.pin-code-box.filled {
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 4px 14px rgba(255, 95, 158, 0.22);
}

.pin-input-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pin-unlock-btn {
  width: 100%;
}

.pin-error {
  min-height: 18px;
  margin-top: 10px;
  color: #ff3b30;
  font-size: 11px;
  font-weight: 800;
}

/* Memory Loading Screen */
.memory-loading-screen {
  position: fixed;
  z-index: 450;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  opacity: 1;
  transition: opacity 0.38s ease;
}

.memory-loading-screen.show {
  display: flex;
}

.memory-loading-screen.leaving {
  opacity: 0;
  pointer-events: none;
}

.memory-loading-orbit {
  width: 58px;
  height: 58px;
  border: 3px solid rgba(255, 95, 158, 0.2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: memorySpin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.memory-loading-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

.memory-loading-caret {
  display: inline-block;
  width: 2px;
  height: 18px;
  margin-left: 2px;
  background: var(--pink);
  animation: memoryBlink 0.7s infinite;
}

@keyframes memoryBlink {
  50% { opacity: 0; }
}
