:root {
  --bg1: #eef2ff;
  --bg2: #fce7f3;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent2: #ef4444;
  --shadow: 0 18px 50px rgba(30, 41, 59, 0.18);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Comic Sans MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 24px 16px;
  min-height: 100vh;
  min-height: 100dvh;
}

.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
  text-align: center;
}

.title {
  position: relative;
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  line-height: 1.25;
  margin: 0 0 8px;
}

.hero-wrap {
  position: relative;
  width: 220px;
  height: 250px;
  margin: 4px auto 0;
}

.hero {
  width: 100%;
  height: 100%;
  animation: bob 3.2s ease-in-out infinite;
}

.hero__shadow { fill: rgba(15, 23, 42, 0.14); }

.hero__arm-left { transform-box: fill-box; transform-origin: center bottom; }

.hero__wave {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: wave-idle 2.8s ease-in-out infinite;
}

.hero.is-waving .hero__wave {
  animation: wave-active 0.36s ease-in-out 4;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes wave-idle {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(10deg); }
}

@keyframes wave-active {
  0%, 100% { transform: rotate(-22deg); }
  50% { transform: rotate(26deg); }
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.sparkle {
  position: absolute;
  bottom: 20%;
  left: 50%;
  font-size: 26px;
  opacity: 0;
  animation: floatUp 1.1s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -160px) scale(1.1) rotate(var(--r, 0deg)); }
}

.form { margin-top: 14px; display: flex; flex-direction: column; gap: 16px; }

.field { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 0.95rem; color: var(--muted); }
.field__label em { font-style: normal; font-size: 0.85rem; }

.field__input {
  font: inherit;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12); }

.btn {
  position: relative;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 16px 20px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease;
  overflow: hidden;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px) scale(0.99); }
.btn:disabled { cursor: progress; filter: saturate(0.7); }

.btn__label { display: inline-block; }
.btn__spinner {
  position: absolute;
  width: 22px; height: 22px;
  left: 50%; top: 50%;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}
.btn.is-loading .btn__label { visibility: hidden; }
.btn.is-loading .btn__spinner { opacity: 1; animation: spin 0.7s linear infinite; }

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

.status { min-height: 1.2em; font-size: 0.98rem; color: var(--muted); }
.status.is-error { color: var(--accent2); }
.status.is-ok { color: #15803d; }

.captcha { display: flex; justify-content: center; min-height: 0; }
.captcha:empty { display: none; }

.gem {
  position: absolute;
  z-index: 4;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: #1e293b;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}
.gem-1 { top: -12px; right: -6px; background: #fde68a; transform: rotate(8deg); }
.gem-2 { top: 2px; left: -16px; background: #bfdbfe; transform: rotate(-10deg); }
.gem-3 { top: 46%; right: -22px; background: #fbcfe8; transform: rotate(7deg); }
.gem-4 { bottom: 6px; left: -14px; background: #bbf7d0; transform: rotate(-6deg); }
.gem-5 { top: 50%; right: -16px; transform: translateY(-50%) rotate(10deg); background: #ddd6fe; }
.gem-6 { bottom: 8px; right: 14px; background: #fed7aa; transform: rotate(-8deg); }

@media (max-width: 380px) {
  .gem-2 { left: -8px; }
  .gem-3 { right: -10px; }
  .gem-4 { left: -6px; }
  .gem-5 { right: -6px; }
}
