/* Стили виджета. Подключать вместе с captcha.js. */

.fcap-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.fcap-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fcap-spin 0.7s linear infinite;
}

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

.fcap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 26, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

/* Ширина модалки равна ширине картинки плюс поля. Растянутая на весь экран,
   она давала ползунок вдвое длиннее пазла: палец проходил вдвое больший путь,
   чем фрагмент, и попасть в место становилось заметно труднее. */
.fcap-modal {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  width: 100%;
  max-width: 536px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fcap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
  color: #1a1d29;
  margin-bottom: 4px;
}

.fcap-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #8a8f9e;
  padding: 0 4px;
}

.fcap-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6b7280;
}

.fcap-stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  user-select: none;
  /* Ширина тянется по месту, но не больше исходного размера картинки:
     на телефоне пазл ужимается целиком, на десктопе не растягивается. */
  width: 100%;
  touch-action: none;
}

/* Ползунок на телефоне должен быть достаточно крупным для пальца. */
.fcap-slider {
  height: 28px;
}

.fcap-bg {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.fcap-piece {
  position: absolute;
  left: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.fcap-slider {
  width: 100%;
  margin-top: 14px;
  accent-color: #2f6df6;
}

.fcap-error {
  margin: 10px 0 0;
  color: #d7263d;
  font-size: 13px;
}

/* Ответ уходит по кнопке, а не по отпусканию ползунка: позицию нужно успеть
   поправить, промах на пару пикселей иначе стоит целой попытки. */
.fcap-submit {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: #2f6df6;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.fcap-submit:disabled {
  background: #c3cbd9;
  cursor: default;
}
