/* ---------- VARIABLES + PAGE ---------- */
:root {
  --black: #1f1f24;
  --pink: #ffb3c1;
  --accent: #2e7d5b;
  --px: 0px;   /* pupil x, set by JavaScript */
  --py: 0px;   /* pupil y */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 56px;
  background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 50%, #ffd3b6 100%);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}
/* ---------- END PAGE ---------- */

/* ---------- SCENE ---------- */
.scene {
  position: relative;
  width: 340px;
  padding-top: 150px;
  margin-bottom: 40px;
}
/* Very narrow phones: zoom shrinks the whole scene (layout included),
   so every pixel offset in the paw animation still lines up */
@media (max-width: 370px) {
  body { padding-left: 12px; padding-right: 12px; }
  .scene { zoom: .86; }
}
/* ---------- END SCENE ---------- */

/* ---------- HEAD ---------- */
.head {
  position: absolute;
  top: 0; left: 50%;
  width: 200px; height: 180px;
  margin-left: -100px;
  z-index: 1;
  transition: transform .4s ease;
}
.ear {
  position: absolute;
  top: -6px;
  width: 64px; height: 64px;
  background: var(--black);
  border-radius: 50%;
}
.ear::after {
  content: ''; position: absolute; inset: 16px;
  background: #3a3a42; border-radius: 50%;
}
.ear.l { left: 4px; }
.ear.r { right: 4px; }
.face {
  position: absolute; inset: 0;
  background: #fff;
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 6px 18px rgba(0,0,0,.12), inset 0 -8px 0 #f1f1f1;
}
/* ---------- END HEAD ---------- */

/* ---------- EYES ---------- */
.patch {
  position: absolute;
  top: 55px;
  width: 52px; height: 62px;
  background: var(--black);
  border-radius: 50%;
  display: grid; place-items: center;
}
.patch.l { left: 38px; transform: rotate(-22deg); }
.patch.r { right: 38px; transform: rotate(22deg); }
.eye {
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  position: relative;
  animation: blink 4.5s infinite;
}
.pupil {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--black);
  border-radius: 50%;
  transform: translate(var(--px), var(--py));
  transition: transform .15s ease;
}
.pupil::after {
  content: ''; position: absolute; top: 2px; left: 3px;
  width: 4px; height: 4px; background: #fff; border-radius: 50%;
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.1); }
}
/* ---------- END EYES ---------- */

/* ---------- NOSE + MOUTH ---------- */
.nose {
  position: absolute;
  top: 112px; left: 50%;
  width: 26px; height: 16px;
  margin-left: -13px;
  background: var(--black);
  border-radius: 50% 50% 60% 60%;
}
.mouth {
  position: absolute;
  top: 124px; left: 50%;
  width: 30px; height: 14px;
  margin-left: -15px;
  border: 3px solid var(--black);
  border-top: none;
  border-radius: 0 0 20px 20px;
  transition: all .3s ease;
}
.blush {
  position: absolute;
  top: 112px;
  width: 22px; height: 12px;
  background: var(--pink);
  border-radius: 50%;
  opacity: .7;
}
.blush.l { left: 34px; }
.blush.r { right: 34px; }
/* ---------- END NOSE + MOUTH ---------- */

/* ---------- ARMS + PAWS ---------- */
.arm {
  position: absolute;
  top: 75px;
  width: 44px; height: 145px;
  background: var(--black);
  border-radius: 22px;
  transform-origin: 50% 100%;
  transform: scaleY(.5);
  z-index: 2;
  transition: transform .45s cubic-bezier(.68,-0.35,.27,1.35);
}
.arm.l { left: 60px; }
.arm.r { right: 60px; }

.paw {
  position: absolute;
  top: 128px;
  width: 60px; height: 46px;
  background: var(--black);
  border-radius: 50% 50% 45% 45%;
  z-index: 4;
  transition: transform .45s cubic-bezier(.68,-0.35,.27,1.35);
}
.paw.l { left: 52px; }
.paw.r { right: 52px; }
.paw i {
  position: absolute;
  width: 10px; height: 10px;
  background: var(--pink);
  border-radius: 50%;
  top: 8px;
}
.paw i:nth-child(1) { left: 10px; }
.paw i:nth-child(2) { left: 25px; top: 5px; }
.paw i:nth-child(3) { left: 40px; }
/* ---------- END ARMS + PAWS ---------- */

/* ---------- CARD / FORM ---------- */
.card {
  position: relative;
  z-index: 3;
  background: #fff;
  border-radius: 24px;
  padding: 46px 30px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
}
.card h2 {
  text-align: center;
  color: var(--black);
  font-weight: 700;
  margin-bottom: 4px;
}
.card p.sub {
  text-align: center;
  color: #767676;
  font-size: 13px;
  margin-bottom: 24px;
}
.field { position: relative; margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 44px 12px 14px;
  border: 2px solid #e6e6e6;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46,125,91,.15);
}
.toggle {
  position: absolute;
  right: 10px; bottom: 9px;
  border: none; background: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
}
.toggle:focus-visible { outline: 2px solid var(--accent); }
.btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s, background .2s;
  margin-top: 6px;
}
.btn:hover { background: #256a4c; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid #1f1f24; outline-offset: 2px; }
.msg {
  text-align: center;
  font-size: 13px;
  margin-top: 14px;
  min-height: 18px;
  font-weight: 500;
}
/* ---------- END CARD / FORM ---------- */

/* ---------- FEET ---------- */
.foot {
  position: absolute;
  bottom: -32px;
  width: 72px; height: 52px;
  background: var(--black);
  border-radius: 50%;
  z-index: 1;
}
.foot.l { left: 62px; }
.foot.r { right: 62px; }
.foot b {
  position: absolute;
  left: 50%; bottom: 8px;
  width: 26px; height: 18px;
  margin-left: -13px;
  background: var(--pink);
  border-radius: 50%;
}
.foot i {
  position: absolute;
  bottom: 28px;
  width: 9px; height: 9px;
  background: var(--pink);
  border-radius: 50%;
}
.foot i:nth-of-type(1) { left: 18px; }
.foot i:nth-of-type(2) { left: 31px; bottom: 31px; }
.foot i:nth-of-type(3) { left: 44px; }
/* ---------- END FEET ---------- */

/* ---------- STATES ---------- */
/* Username focus: look down at the form */
.scene.look { --py: 4px; }

/* Password focus: cover eyes */
.scene.cover .arm.l { transform: rotate(21deg) scaleY(1); }
.scene.cover .arm.r { transform: rotate(-21deg) scaleY(1); }
.scene.cover .paw.l { transform: translate(52px, -66px) rotate(18deg); }
.scene.cover .paw.r { transform: translate(-52px, -66px) rotate(-18deg); }

/* Show password: right paw peeks */
.scene.cover.peek .arm.r { transform: rotate(-24deg) scaleY(.82); }
.scene.cover.peek .paw.r { transform: translate(-58px, -40px) rotate(-30deg); }

/* Happy on success */
.scene.happy .mouth { height: 20px; width: 36px; margin-left: -18px; background: #ff7a8a; }
.scene.happy .foot { animation: tap .35s ease 3; }
.scene.happy .head { animation: bounce .5s ease 2; }
@keyframes tap { 50% { transform: translateY(-8px); } }
@keyframes bounce { 50% { transform: translateY(-10px); } }

/* Sad shake on error */
.scene.sad .mouth { border-radius: 20px 20px 0 0; border-top: 3px solid var(--black); border-bottom: none; top: 130px; }
.scene.sad .head { animation: shake .45s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px) rotate(-3deg); }
  40%, 80% { transform: translateX(8px) rotate(3deg); }
}
/* ---------- END STATES ---------- */

/* ---------- REDUCED MOTION ---------- */
/* Respect visitors who turn animations off in their system settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* ---------- END REDUCED MOTION ---------- */
