:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --ink: #211b20;
  --soft: #675b64;
  --rose: #9b607e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #ead3e1;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.lock-ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 110%, rgba(196, 189, 232, 0.75), transparent 48%),
    linear-gradient(155deg, #f5dce7 0%, #e8cedf 48%, #dfd5ec 100%);
}

.lock-ambient i {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  animation: lock-drift 12s ease-in-out infinite alternate;
}

.lock-ambient i:nth-child(1) {
  top: -16vw;
  right: -22vw;
  width: 62vw;
  height: 62vw;
  background: rgba(255, 245, 249, 0.64);
}

.lock-ambient i:nth-child(2) {
  bottom: 3vh;
  left: -26vw;
  width: 70vw;
  height: 70vw;
  background: rgba(214, 200, 237, 0.56);
  animation-delay: -4s;
}

.lock-ambient i:nth-child(3) {
  top: 38%;
  right: -18vw;
  width: 45vw;
  height: 45vw;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(228, 181, 208, 0.22);
  animation-delay: -7s;
}

@keyframes lock-drift {
  to { transform: translate3d(1rem, -1.3rem, 0) scale(1.06); }
}

.lock-page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(1.2rem + env(safe-area-inset-top)) 1rem calc(1.2rem + env(safe-area-inset-bottom));
}

.lock-card {
  width: min(100%, 23rem);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 2rem;
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 255, 255, 0.72), transparent 29%),
    rgba(255, 245, 250, 0.39);
  box-shadow: 0 30px 90px rgba(76, 47, 67, 0.18), inset 0 1px rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  animation: lock-card-in 700ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes lock-card-in {
  from { opacity: 0; transform: translateY(1rem) scale(0.975); filter: blur(7px); }
}

.lock-mark {
  position: relative;
  width: 3.5rem;
  height: 2.4rem;
  margin-bottom: 2.25rem;
}

.lock-mark span {
  position: absolute;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 1.5px solid rgba(92, 55, 78, 0.68);
  border-radius: 50%;
}

.lock-mark span:first-child { left: 0; }
.lock-mark span:last-child { right: 0; border-color: rgba(157, 92, 125, 0.72); }

.lock-card header > p {
  margin: 0;
  color: var(--rose);
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.15em;
}

.lock-card h1 {
  margin: 0.7rem 0 0;
  font-size: clamp(3.6rem, 18vw, 5rem);
  font-weight: 690;
  line-height: 0.88;
  letter-spacing: -0.085em;
}

.lock-card header > span {
  display: block;
  margin-top: 1.15rem;
  color: var(--soft);
  font-size: 0.79rem;
  line-height: 1.45;
}

.lock-form {
  margin-top: 2.4rem;
}

.lock-form label {
  display: block;
  margin: 0 0 0.55rem 0.2rem;
  color: #876174;
  font-size: 0.59rem;
  font-weight: 730;
  letter-spacing: 0.12em;
}

.lock-input-wrap {
  position: relative;
}

.lock-form input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 4rem;
  padding: 0 1.15rem;
  outline: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.2rem;
  background: rgba(255, 252, 253, 0.55);
  color: var(--ink);
  caret-color: #975d79;
  font-size: 1.25rem;
  font-weight: 640;
  letter-spacing: 0.18em;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.7);
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.lock-form input::placeholder {
  color: rgba(84, 65, 77, 0.31);
}

.lock-input-glow {
  position: absolute;
  inset: 0.3rem;
  border-radius: 1rem;
  background: rgba(201, 137, 171, 0.24);
  filter: blur(15px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.lock-form input:focus {
  border-color: rgba(159, 96, 127, 0.48);
  background: rgba(255, 252, 253, 0.72);
  box-shadow: 0 10px 34px rgba(104, 65, 89, 0.11), inset 0 1px rgba(255, 255, 255, 0.78);
}

.lock-input-wrap:focus-within .lock-input-glow { opacity: 1; }

.lock-message {
  min-height: 1.8rem;
  margin: 0.55rem 0 0;
  padding: 0 0.2rem;
  color: #9d536c;
  font-size: 0.67rem;
  line-height: 1.35;
}

.lock-form button {
  width: 100%;
  height: 3.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 999px;
  background: #241e22;
  color: #fff9fc;
  font-size: 0.78rem;
  font-weight: 650;
  box-shadow: 0 15px 35px rgba(49, 32, 43, 0.2);
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.lock-form button:active { transform: scale(0.98); }
.lock-form button:disabled { cursor: wait; opacity: 0.62; }

.lock-form button svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms ease;
}

.lock-form button:not(:disabled):hover svg { transform: translateX(0.15rem); }

.lock-card footer {
  margin-top: 2rem;
  color: rgba(77, 60, 71, 0.48);
  font-size: 0.58rem;
  text-align: center;
}

.lock-card footer span { margin: 0 0.25rem; }

.unlock-wash {
  position: fixed;
  z-index: 10;
  inset: -10%;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(252, 232, 242, 0.98);
  opacity: 0;
  transform: scale(0.03);
}

body.is-unlocking .lock-card {
  animation: lock-open 780ms cubic-bezier(.2,.8,.2,1) both;
}

body.is-unlocking .lock-mark span:first-child { animation: ring-left 580ms ease both; }
body.is-unlocking .lock-mark span:last-child { animation: ring-right 580ms ease both; }
body.is-unlocking .unlock-wash { animation: unlock-wash 820ms 180ms cubic-bezier(.4,0,.2,1) both; }

@keyframes ring-left { to { transform: translateX(0.55rem); border-color: #fff; } }
@keyframes ring-right { to { transform: translateX(-0.55rem); border-color: #fff; } }
@keyframes lock-open { to { opacity: 0; transform: scale(1.035); filter: blur(10px); } }
@keyframes unlock-wash { 55% { opacity: 1; } to { opacity: 1; transform: scale(2.2); } }

@media (max-height: 650px) {
  .lock-card { padding: 1rem 1.15rem; }
  .lock-mark { margin-bottom: 1.2rem; }
  .lock-card h1 { font-size: 3.4rem; }
  .lock-form { margin-top: 1.35rem; }
  .lock-card footer { margin-top: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
