/* ---------- VARIABLES + PAGE ---------- */
:root {
  --bg: linear-gradient(135deg, #ffe0b2 0%, #ffccbc 55%, #f8bbd0 100%);
  --fur: #8b5a3c;      /* head and ears */
  --body: #6f442c;     /* arms, paws and feet (a shade darker) */
  --pad: #f0cfa8;      /* muzzle, inner ears, toe beans */
  --ink: #3e2418;      /* nose and mouth */
  --accent: #c0603a;   /* button and focus ring */
  --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: var(--bg);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}
/* ---------- END PAGE ---------- */

/* ---------- SCENE ---------- */
.scene {
  position: relative;
  width: 340px;
  padding-top: 150px;
  margin-bottom: 40px;
}
@media (max-width: 370px) {
  body { padding-left: 12px; padding-right: 12px; }
  .scene { zoom: .86; }
}
/* ---------- END SCENE ---------- */

/* ---------- HEAD, EARS + MUZZLE ---------- */
.head {
  position: absolute;
  top: 0; left: 50%;
  width: 200px; height: 180px;
  margin-left: -100px;
  z-index: 1;
}
.ear {
  position: absolute;
  top: -4px;
  width: 62px; height: 62px;
  background: var(--fur);
  border-radius: 50%;
}
.ear::after {
  content: '';
  position: absolute;
  inset: 14px;
  background: var(--pad);
  border-radius: 50%;
}
.ear.l { left: 8px; }
.ear.r { right: 8px; }
.face {
  position: absolute;
  inset: 0;
  background: var(--fur);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 6px 18px rgba(0,0,0,.15), inset 0 -8px 0 rgba(0,0,0,.08);
}
.muzzle {
  position: absolute;
  top: 96px; left: 50%;
  width: 86px; height: 62px;
  margin-left: -43px;
  background: var(--pad);
  border-radius: 50%;
}
/* ---------- END HEAD ---------- */

/* ---------- EYES ---------- */
.patch {
  position: absolute;
  top: 55px;
  width: 52px; height: 62px;
  display: grid;
  place-items: center;
}
.patch.l { left: 38px; }
.patch.r { right: 38px; }
.eye {
  position: relative;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  overflow: hidden;
  animation: blink 4.5s infinite;
}
.pupil {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: #2b1b14;
  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 + CHEEKS ---------- */
.nose {
  position: absolute;
  top: 104px; left: 50%;
  width: 26px; height: 16px;
  margin-left: -13px;
  background: var(--ink);
  border-radius: 50% 50% 60% 60%;
}
.mouth {
  position: absolute;
  top: 117px; left: 50%;
  width: 30px; height: 14px;
  margin-left: -15px;
  border: 3px solid var(--ink);
  border-top: none;
  border-radius: 0 0 20px 20px;
  transition: all .3s ease;
}
.blush {
  position: absolute;
  top: 102px;
  width: 22px; height: 12px;
  background: #ffb3c1;
  border-radius: 50%;
  opacity: .7;
}
.blush.l { left: 24px; }
.blush.r { right: 24px; }
/* ---------- END NOSE ---------- */

/* ---------- ARMS + PAWS ---------- */
.arm {
  position: absolute;
  top: 75px;
  width: 44px; height: 145px;
  background: var(--body);
  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(--body);
  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;
  top: 8px;
  width: 10px; height: 10px;
  background: var(--pad);
  border-radius: 50%;
}
.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 ---------- */

/* ---------- CARD / FORM ---------- */
.card {
  position: relative;
  z-index: 3;
  background: #fff;
  border-radius: 24px;
  padding: 46px 30px 30px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.card h2 { text-align: center; color: #1f1f24; font-weight: 700; margin-bottom: 2px; }
.card p.sub { text-align: center; color: #767676; font-size: 13px; margin-bottom: 22px; }
.field { position: relative; margin-bottom: 16px; }
.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 color-mix(in srgb, var(--accent) 18%, transparent);
}
.field input[aria-invalid="true"] { border-color: #d64545; }
.toggle {
  position: absolute;
  right: 10px; bottom: 9px;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.toggle:focus-visible { outline: 2px solid var(--accent); }
.btn {
  width: 100%;
  margin-top: 4px;
  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, filter .2s;
}
.btn:hover { filter: brightness(.92); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid #1f1f24; outline-offset: 2px; }
.msg { text-align: center; font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }
/* ---------- END CARD ---------- */

/* ---------- FEET ---------- */
.foot {
  position: absolute;
  bottom: -32px;
  width: 72px; height: 52px;
  background: var(--body);
  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(--pad);
  border-radius: 50%;
}
.foot i {
  position: absolute;
  bottom: 28px;
  width: 9px; height: 9px;
  background: var(--pad);
  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 ---------- */
/* Typing in a text field: look down at the form */
.scene.look { --py: 4px; }

/* Typing a password: both paws over the 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); }

/* Password shown: the right paw lifts to peek */
.scene.cover.peek .arm.r { transform: rotate(-24deg) scaleY(.82); }
.scene.cover.peek .paw.r { transform: translate(-58px, -40px) rotate(-30deg); }

/* Success: big smile, bounce, happy feet */
.scene.happy .mouth { width: 36px; height: 20px; 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); } }

/* Problem: frown and head shake */
.scene.sad .mouth {
  top: 123px;
  border-top: 3px solid var(--ink);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
}
.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 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* ---------- END REDUCED MOTION ---------- */
