/* ============================================================
   Капча-слайдер (jigsaw) — перетащите пазл в замок
   Стиль: как формы сайта (border 1px #2E2E2E, прямые углы,
   фон #F6F6F6 как у .modal_form, brand #E4234E, Montserrat,
   без тяжёлых теней).
   ============================================================ */

.sc {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin-top: 12px;
    font-family: 'Montserrat', Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

/* ---- Область пазла ---- */
.sc-puzzle {
    position: relative;
    width: 100%;
    border: 1px solid #2E2E2E;
    border-radius: 0;
    overflow: hidden;
    background: #F6F6F6;
}

.sc-bg {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity .25s ease;
}

.sc-bg.loaded { opacity: 1; }

.sc-piece {
    position: absolute;
    top: 0;
    left: 0;
    will-change: left;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
}

/* Кнопка обновления (сверху справа) */
.sc-refresh {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 0;
    background: rgba(0, 0, 0, .4);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
    z-index: 3;
}
.sc-refresh:hover { background: rgba(0, 0, 0, .65); }

/* Оверлей загрузки */
.sc-loading {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 12px;
    font-weight: 500;
    background: #F6F6F6;
    z-index: 2;
}
.sc-loading.hidden { display: none; }

/* ---- Трек ползунка ---- */
.sc-track {
    position: relative;
    height: 40px;
    margin-top: 10px;
    border: 1px solid #2E2E2E;
    border-radius: 0;
    background: #F6F6F6;
    overflow: hidden;
}

.sc-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: rgba(228, 35, 78, .12);
    pointer-events: none;
}

.sc-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: #E4234E;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    touch-action: none;
    transition: background .15s ease;
    z-index: 2;
}
.sc-handle:hover { background: #a81233; }
.sc-handle:active { cursor: grabbing; }
.sc-handle:focus { outline: none; box-shadow: 0 0 0 2px rgba(228, 35, 78, .4); }

/* Подпись-статус */
.sc-status {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    min-height: 16px;
    transition: color .2s ease;
}

/* ---- Состояние: успех ---- */
.sc.ok .sc-track { border-color: #15803d; }
.sc.ok .sc-fill { background: rgba(21, 128, 61, .12); }
.sc.ok .sc-handle { background: #15803d; cursor: default; }
.sc.ok .sc-handle:hover { background: #15803d; }
.sc.ok .sc-status { color: #15803d; font-weight: 600; }
.sc.ok .sc-refresh { display: none; }

/* ---- Состояние: ошибка + тряска ---- */
.sc.err .sc-status { color: #c0392b; font-weight: 600; }
.sc.err .sc-puzzle { animation: sc-shake .42s ease; }

@keyframes sc-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Узкие экраны (мобильная модалка ~290px) */
@media (max-width: 480px) {
    .sc { max-width: 100%; }
    .sc-track { height: 36px; }
    .sc-handle { width: 32px; height: 32px; }
}
