/* Стили для модального окна капчи */

.hsc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hsc-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.hsc-captcha-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.hsc-modal-overlay.show .hsc-captcha-wrapper {
    transform: scale(1);
}

.hsc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.hsc-logo {
    display: flex;
    align-items: center;
}

.hsc-logo-text {
    font-size: 18px;
    font-weight: bold;
    color: #2155FC;
    letter-spacing: 1px;
}

.hsc-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease;
}

.hsc-close-btn:hover {
    color: #333;
}

.hsc-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    text-align: center;
}

.hsc-description {
    font-size: 16px;
    color: #666;
    margin: 0 0 25px 0;
    text-align: center;
}

.hsc-preview {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
    background: #f8f9fa;
}

.hsc-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hsc-preview-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(0,0,0,0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: calc(100% / var(--slices, 6)) calc(100% / var(--slices, 6));
    pointer-events: none;
}

.hsc-controls {
    margin-bottom: 20px;
}

.hsc-slider-wrap {
    position: relative;
    margin-bottom: 20px;
}

.hsc-pos {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.hsc-pos::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #2155FC;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(33, 85, 252, 0.3);
    transition: all 0.2s ease;
}

.hsc-pos::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(33, 85, 252, 0.4);
}

.hsc-pos::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #2155FC;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(33, 85, 252, 0.3);
    transition: all 0.2s ease;
}

.hsc-pos::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(33, 85, 252, 0.4);
}

.hsc-verify-btn {
    width: 100%;
    padding: 15px;
    background: #2155FC;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hsc-verify-btn:hover:not(:disabled) {
    background: #1a47d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 85, 252, 0.3);
}

.hsc-verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hsc-status {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
    margin-top: 15px;
}

.hsc-status.success {
    color: #28a745;
}

.hsc-status.error {
    color: #dc3545;
}

/* Лоадер для модального окна */
.hsc-preview.loading {
    position: relative;
}

.hsc-preview.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,0.15);
    border-top-color: #2155FC;
    animation: hsc-spin 0.8s linear infinite;
    z-index: 3;
}

.hsc-preview.loading img.hsc-captcha-img {
    filter: blur(2px) brightness(0.92);
    opacity: 0.7;
}

@keyframes hsc-spin {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

/* Блокировка скролла при открытом модальном окне */
body.hsc-modal-open {
    overflow: hidden;
}

/* Адаптивность */
@media (max-width: 600px) {
    .hsc-captcha-wrapper {
        padding: 20px;
        margin: 20px;
    }
    
    .hsc-title {
        font-size: 20px;
    }
    
    .hsc-description {
        font-size: 14px;
    }
    
    .hsc-preview {
        height: 150px;
    }
}