.application-form [aria-invalid="true"] {
  border-color: #c83d4f !important;
  box-shadow: 0 0 0 3px rgba(200, 61, 79, 0.12) !important;
}

.field-error {
  display: block;
  margin: 6px 0 0;
  color: #a9283b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.puzzle-captcha {
  margin: 22px 0 20px;
  padding: 18px;
  border: 1px solid #dfe3e9;
  border-radius: 16px;
  background: #f7f8fb;
}

.puzzle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.puzzle-reset {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--electric);
  font-size: 12px;
  font-weight: 800;
}

.puzzle-captcha > p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.puzzle-stage {
  --target-x: 72%;
  position: relative;
  height: 98px;
  overflow: hidden;
  border: 1px solid rgba(67, 103, 255, 0.22);
  border-radius: 13px;
  background:
    radial-gradient(circle at 78% 34%, rgba(129, 150, 255, 0.42), transparent 24%),
    linear-gradient(135deg, #14294f, #0d1830);
  touch-action: none;
  user-select: none;
}

.puzzle-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(120deg, transparent 0 22px, rgba(255, 255, 255, 0.025) 22px 23px);
  pointer-events: none;
}

.puzzle-target,
.puzzle-piece {
  position: absolute;
  top: 21px;
  width: 56px;
  height: 56px;
  border-radius: 11px;
}

.puzzle-target {
  left: var(--target-x);
  z-index: 2;
  display: grid;
  place-items: center;
  border: 3px dashed #ffffff;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 123, 114, 0.28), inset 0 0 18px rgba(255, 255, 255, 0.12);
  animation: puzzle-target-pulse 1.6s ease-in-out infinite;
}

.puzzle-target::before {
  content: "IDE";
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
}

@keyframes puzzle-target-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 123, 114, 0.22), inset 0 0 18px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 0 7px rgba(255, 123, 114, 0.42), inset 0 0 22px rgba(255, 255, 255, 0.18); }
}

.puzzle-piece {
  left: 10px;
  z-index: 3;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(145deg, var(--coral), #ff9b94);
  cursor: grab;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.18s, background 0.18s;
}

.puzzle-piece::before,
.puzzle-piece::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.puzzle-piece::before {
  top: 17px;
  right: -10px;
  background: var(--coral);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-left: 0;
}

.puzzle-piece::after {
  top: -9px;
  left: 17px;
  background: #14294f;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.puzzle-piece:active {
  cursor: grabbing;
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.38);
}

.puzzle-piece:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.puzzle-captcha.is-solved {
  border-color: rgba(54, 132, 91, 0.42);
  background: #f3faf6;
}

.puzzle-captcha.is-solved .puzzle-piece {
  border-color: #fff;
  background: #46a16d;
  cursor: default;
}

.puzzle-captcha.is-solved .puzzle-piece::before {
  background: #46a16d;
}

.puzzle-captcha.is-solved .puzzle-target {
  animation: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.puzzle-captcha.is-solved .puzzle-target::before {
  content: "";
}

.puzzle-status {
  min-height: 19px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.puzzle-captcha.is-solved .puzzle-status {
  color: #347653;
}

.puzzle-captcha.has-error .puzzle-status {
  color: #a9283b;
}

@media (max-width: 600px) {
  .puzzle-captcha {
    padding: 15px;
  }

  .puzzle-heading {
    align-items: flex-start;
  }
}
