/* Стили для отцентрированной капчи */
.captcha-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.captcha-challenge {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.captcha-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Стили для изображения капчи */
.captcha-challenge img {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 100%;
    height: auto;
    transition: all 0.2s ease-in-out;
    display: block;
    margin: 0 auto;
}

.captcha-challenge img:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Анимация загрузки */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Стили для поля ввода */
.captcha-input-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.captcha-input {
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    font-size: 1.125rem;
    line-height: 1.75rem;
}

/* Стили для кнопки обновления */
.captcha-refresh-btn {
    transition: all 0.2s ease-in-out;
    transform-origin: center;
}

.captcha-refresh-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.captcha-refresh-btn:active {
    transform: scale(0.95);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 640px) {
    .captcha-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .captcha-challenge {
        min-height: 140px;
        padding: 1rem;
    }
    
    .captcha-challenge img {
        max-width: 90%;
    }
    
    .captcha-input-container {
        max-width: 100%;
    }
}

/* Темная тема */
.dark .captcha-challenge {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: #4b5563;
}

.dark .captcha-challenge img {
    border-color: #6b7280;
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.captcha-container {
    animation: fadeInUp 0.5s ease-out;
}

/* Стили для состояний загрузки */
.captcha-loading {
    opacity: 0.7;
    pointer-events: none;
}

.captcha-loading .captcha-refresh-btn {
    animation: spin 1s linear infinite;
}

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

/* Улучшенные фокусы для доступности */
.captcha-input:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    ring-offset: 2px;
}

/* Стили для ошибок */
.captcha-error {
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: #fef2f2;
    border-radius: 0.375rem;
    border: 1px solid #fecaca;
}

.dark .captcha-error {
    background-color: #7f1d1d;
    border-color: #dc2626;
    color: #fca5a5;
}

/* Стили для успешной валидации */
.captcha-success {
    color: #059669;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: #f0fdf4;
    border-radius: 0.375rem;
    border: 1px solid #bbf7d0;
}

.dark .captcha-success {
    background-color: #064e3b;
    border-color: #059669;
    color: #6ee7b7;
}
