/* css/08-lock.css — Beautiful 2-user login (lk2 namespace) */

.lock-screen.lk2 {
  position: fixed; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, #0E2E22 0%, #06150E 55%, #020906 100%);
  color: #E2F2EA;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding: max(28px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  z-index: 9999;
  overflow: hidden;
  font-family: "IBM Plex Sans Thai", "Inter", system-ui, sans-serif;
}
.lock-screen.lk2.is-out {
  animation: lk2-out .36s cubic-bezier(.4,.0,.2,1) forwards;
}
@keyframes lk2-out {
  to { opacity: 0; transform: scale(1.04); }
}

/* ───── background blobs ───── */
.lk2-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  z-index: 0;
}
.lk2-blob {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.45;
  mix-blend-mode: screen;
  animation: lk2-float 18s ease-in-out infinite alternate;
}
.lk2-b1 { width: 360px; height: 360px; background: #10B981; top: -120px; left: -80px; }
.lk2-b2 { width: 320px; height: 320px; background: #34D399; bottom: -100px; right: -60px; animation-duration: 22s; animation-delay: -4s; }
.lk2-b3 { width: 260px; height: 260px; background: #F472B6; top: 35%; right: -120px; opacity: 0.30; animation-duration: 26s; animation-delay: -8s; }
@keyframes lk2-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -22px) scale(1.08); }
}
.lk2-grain {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.5;
}

/* ───── brand ───── */
.lk2-brand {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
  max-width: 420px; width: 100%;
}
.lk2-logo { width: 56px; height: 56px; flex: 0 0 auto; filter: drop-shadow(0 8px 18px rgba(16,185,129,0.4)); }
.lk2-logo svg { width: 100%; height: 100%; display: block; }
.lk2-brand-eyebrow {
  font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.50); font-weight: 700;
}
.lk2-brand-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
  margin: 2px 0 4px; color: #fff;
}
.lk2-brand-sub {
  font-size: 12.5px; color: rgba(255,255,255,0.55); margin: 0;
}

/* ───── stage ───── */
.lk2-stage {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.lk2-card {
  width: 100%;
  background: rgba(18, 36, 28, 0.62);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 28px;
  padding: 22px 20px 24px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  animation: lk2-in .42s cubic-bezier(.16,1,.3,1) both;
}
@keyframes lk2-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lk2-card.is-shake { animation: lk2-shake .42s ease both; }
@keyframes lk2-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

/* ───── profile pick ───── */
.lk2-pick-label {
  font-size: 13px; color: rgba(255,255,255,0.55); margin: 0 0 14px;
  font-weight: 600; letter-spacing: 0.02em; text-align: center;
}
.lk2-pick-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.lk2-pick-card {
  position: relative;
  background: linear-gradient(160deg, color-mix(in oklab, var(--c1) 22%, transparent), color-mix(in oklab, var(--c2) 16%, transparent));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  padding: 20px 14px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #fff; cursor: pointer;
  transition: transform .18s cubic-bezier(.4,.0,.2,1), border-color .15s, background .25s;
  overflow: hidden;
}
.lk2-pick-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% -20%, color-mix(in oklab, var(--c1) 35%, transparent), transparent 65%);
  pointer-events: none;
}
.lk2-pick-card:hover  { transform: translateY(-2px); border-color: rgba(255,255,255,0.20); }
.lk2-pick-card:active { transform: scale(0.97); }
.lk2-pick-avatar {
  width: 58px; height: 58px; border-radius: 18px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 24px;
  box-shadow: 0 10px 22px -6px color-mix(in oklab, var(--c1) 70%, black 0%);
  position: relative; z-index: 1;
}
.lk2-pick-avatar span { letter-spacing: 0; }
.lk2-pick-name {
  font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
  position: relative; z-index: 1;
}
.lk2-pick-meta {
  font-size: 11.5px; color: rgba(255,255,255,0.55); font-weight: 500;
  position: relative; z-index: 1;
}
.lk2-pick-emoji {
  position: absolute; right: 10px; top: 10px;
  font-size: 18px; opacity: 0.55;
}
.lk2-pick-hint {
  font-size: 11.5px; color: rgba(255,255,255,0.40);
  margin: 14px 0 0; text-align: center;
}

/* ───── PIN pad ───── */
.lk2-card-pad { position: relative; }
.lk2-back {
  position: absolute; top: 14px; left: 14px;
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.75);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.lk2-back svg { width: 18px; height: 18px; }

.lk2-pad-head {
  display: flex; align-items: center; gap: 14px;
  margin: 10px 0 18px; padding-left: 52px;
}
.lk2-pad-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 22px;
  box-shadow: 0 8px 18px -6px color-mix(in oklab, var(--c1) 60%, black 0%);
  flex: 0 0 auto;
}
.lk2-pad-hello {
  font-size: 12px; color: rgba(255,255,255,0.50); letter-spacing: 0.02em;
}
.lk2-pad-name {
  font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.01em;
}
.lk2-pad-prompt {
  font-size: 13px; color: rgba(255,255,255,0.55);
  margin: 0 0 14px; text-align: center;
}

.lk2-dots {
  display: flex; gap: 14px; justify-content: center;
  margin-bottom: 6px;
}
.lk2-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  transition: background .14s, transform .14s, border-color .14s;
}
.lk2-dots span.is-filled {
  background: linear-gradient(140deg, var(--c1), var(--c2));
  border-color: transparent;
  transform: scale(1.18);
  box-shadow: 0 0 14px color-mix(in oklab, var(--c1) 55%, transparent);
}
.lk2-msg {
  height: 18px; color: #FCA5A5; font-size: 12.5px; font-weight: 600;
  text-align: center; margin: 6px 0 14px;
}

.lk2-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.lk2-k {
  height: 60px; border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 22px; font-weight: 600;
  font-feature-settings: "tnum";
  cursor: pointer;
  transition: background .12s, transform .08s, border-color .12s;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.lk2-k:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); }
.lk2-k:active { transform: scale(0.94); background: rgba(255,255,255,0.14); }
.lk2-k-ghost { visibility: hidden; pointer-events: none; }
.lk2-k-back  { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.18); color: #FCA5A5; }
.lk2-k-back svg { width: 22px; height: 22px; }

/* ───── footer ───── */
.lk2-foot {
  position: relative; z-index: 1;
  margin-top: 14px;
  font-size: 10.5px; color: rgba(255,255,255,0.30);
  text-align: center;
}

/* Hide legacy elements if they sneak in */
.lock-screen.lk2 .lock-card,
.lock-screen.lk2 .lock-pad:not(.lk2-pad),
.lock-screen.lk2 > .lock-logo,
.lock-screen.lk2 > .lock-title,
.lock-screen.lk2 > .lock-sub,
.lock-screen.lk2 > .lock-dots,
.lock-screen.lk2 > .lock-msg { display: none !important; }

/* compact for short screens */
@media (max-height: 700px) {
  .lk2-brand { margin-bottom: 14px; }
  .lk2-brand-title { font-size: 19px; }
  .lk2-card { padding: 16px 16px 18px; border-radius: 22px; }
  .lk2-k { height: 52px; font-size: 19px; border-radius: 14px; }
  .lk2-pick-avatar { width: 50px; height: 50px; font-size: 20px; }
  .lk2-pad-avatar { width: 46px; height: 46px; font-size: 19px; }
}
