/* Contenedor principal */
.simple-captcha-widget {
    font-family: inherit;
    margin: 20px 0;
}

/* Contenedor del CAPTCHA */
.simple-captcha-widget .captcha-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
}

/* Wrapper de imagen */
.simple-captcha-widget .captcha-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f9f9f9;
    padding: 10px;
    min-height: 100px;
    overflow: hidden;
}

/* Imagen CAPTCHA */
.simple-captcha-widget .captcha-image {
    max-width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Botón refresh */
.simple-captcha-widget .captcha-refresh-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.85;
}

.simple-captcha-widget .captcha-refresh-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.simple-captcha-widget .captcha-refresh-btn:active {
    transform: scale(0.98);
}

.simple-captcha-widget .refresh-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.simple-captcha-widget .captcha-refresh-btn:hover .refresh-icon {
    transform: rotate(-180deg);
}

/* Wrapper del input */
.simple-captcha-widget .captcha-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.simple-captcha-widget .captcha-input-wrapper label {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

/* Input de respuesta */
.simple-captcha-widget .captcha-answer {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.simple-captcha-widget .captcha-answer:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.simple-captcha-widget .captcha-answer:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Mensaje de estado */
.simple-captcha-widget .captcha-message {
    min-height: 20px;
    font-size: 14px;
    border-radius: 4px;
    padding: 10px 12px;
    display: none;
    margin-top: 5px;
}

.simple-captcha-widget .captcha-message.error {
    display: block;
    background-color: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.simple-captcha-widget .captcha-message.success {
    display: block;
    background-color: #efe;
    color: #3c3;
    border-left: 4px solid #3c3;
}

/* Responsive */
@media (max-width: 480px) {
    .simple-captcha-widget .captcha-container {
        max-width: 100%;
    }
    
    .simple-captcha-widget .captcha-image-wrapper {
        min-height: 80px;
        padding: 8px;
    }
    
    .simple-captcha-widget .captcha-refresh-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .simple-captcha-widget .captcha-answer {
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .simple-captcha-widget .captcha-image-wrapper {
        background-color: #2a2a2a;
        border-color: #444;
    }
    
    .simple-captcha-widget .captcha-answer {
        background-color: #1a1a1a;
        color: #fff;
        border-color: #444;
    }
    
    .simple-captcha-widget .captcha-answer:focus {
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    }
    
    .simple-captcha-widget .captcha-input-wrapper label {
        color: #ddd;
    }
    
    .simple-captcha-widget .captcha-message.error {
        background-color: #3a2525;
        border-left-color: #ff6b6b;
    }
    
    .simple-captcha-widget .captcha-message.success {
        background-color: #253a2a;
        border-left-color: #51cf66;
    }
}
