/* Springy Input — springs from DesignBookmark:
   --input-caret: 700 32 · --input-morph: 300 20
   Visuals use site tokens (--blue, --ink, --muted, --radius). */
:root {
  --input-caret: 700 32;
  --input-morph: 300 20;
}

.si-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.si-field {
  position: relative;
  width: 100%;
  height: 56px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0, 153, 255, 0.22);
  box-shadow: 0 0 0 4px rgba(0, 153, 255, 0.06);
  overflow: hidden;
  will-change: width, transform;
  transition: box-shadow 0.25s, background 0.3s, border-color 0.25s;
}

.si-field.focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 5px rgba(0, 153, 255, 0.14);
}

.si-field.err {
  border-color: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
}

.si-field.ok {
  background: #22c55e;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.28);
}

.si-label {
  position: absolute;
  left: 22px;
  top: 17px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  transform-origin: left top;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.si-box {
  position: absolute;
  left: 22px;
  right: 58px;
  top: 16px;
  height: 24px;
}

.si-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  white-space: pre;
  pointer-events: none;
}

.si-layer-in {
  position: absolute;
  left: 0;
  top: 0;
  height: 24px;
  line-height: 24px;
  white-space: pre;
}

.si-ch {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 24px;
  font-kerning: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  transform-origin: 50% 80%;
  letter-spacing: -0.02em;
}

.si-ch.in { animation: si-drop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--d, 0ms); }
.si-ch.out { position: absolute; top: 0; animation: si-out 0.34s cubic-bezier(0.5, 0, 0.75, 0) forwards; }
.si-ch.nope { animation: si-nope 0.46s ease both; animation-delay: var(--d, 0ms); }
.si-ch.fly { animation: si-fly 0.42s cubic-bezier(0.5, 0, 0.75, 0) forwards; animation-delay: var(--d, 0ms); }

@keyframes si-drop {
  0% { transform: translateY(14px) rotate(-16deg) scale(0.5); opacity: 0; filter: blur(3px); }
  55% { transform: translateY(-3px) rotate(4deg) scale(1.1); opacity: 1; filter: none; }
  80% { transform: translateY(1px) rotate(-1deg) scale(0.98); }
  100% { transform: none; }
}
@keyframes si-out { to { transform: translateY(-18px) rotate(20deg) scale(0.5); opacity: 0; filter: blur(3px); } }
@keyframes si-nope {
  0%, 100% { transform: none; }
  20% { transform: translateX(-4px) rotate(-8deg); }
  40% { transform: translateX(4px) rotate(6deg); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(1px); }
}
@keyframes si-fly { to { transform: translateY(-28px) scale(0.6); opacity: 0; filter: blur(4px); } }

.si-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: none;
  padding: 0;
  font: 650 0.95rem ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 24px;
  font-kerning: none;
  letter-spacing: -0.02em;
  color: transparent;
  caret-color: transparent;
}
.si-input::selection { background: rgba(0, 153, 255, 0.18); color: transparent; }

.si-caret {
  position: absolute;
  left: 0;
  top: 2px;
  width: 2px;
  height: 20px;
  border-radius: 2px;
  background: var(--blue);
  opacity: 0;
  pointer-events: none;
  transform-origin: left center;
}
.si-caret.blink { animation: si-blink 1s steps(1) infinite; }
@keyframes si-blink { 50% { opacity: 0; } }

.si-go {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s, background 0.2s;
}
.si-go svg { width: 20px; height: 20px; }
.si-go.idle { transform: scale(0.82); opacity: 0.4; }
.si-go:active { transform: scale(0.88); }
.si-go:hover:not(.idle) { background: var(--blue-hover); }

.si-field.ok .si-go,
.si-field.ok .si-label,
.si-field.ok .si-box { opacity: 0; pointer-events: none; }

.si-done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}
.si-done svg { width: 20px; height: 20px; }
.si-done path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.si-field.ok .si-done {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s 0.15s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}
.si-field.ok .si-done path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.65, 0, 0.35, 1) 0.3s;
}

.si-help {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 18px;
  text-align: center;
  transition: color 0.2s;
}
.si-help.err { color: #b45309; }
