/**
 * FFM Image CAPTCHA – Styles
 * Version: 1.5.0
 */

.ffm-captcha-wrap {
    margin: 1em 0;
    padding: 0;
}

/* Header: question + refresh button */
.ffm-captcha-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0.75em 0;
    flex-wrap: wrap;
}

.ffm-captcha-question {
    margin: 0;
    font-size: 0.95em;
    color: inherit;
}

/* Refresh button */
.ffm-captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f9f9f9;
    color: #666;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    flex-shrink: 0;
}

.ffm-captcha-refresh:hover {
    color: #0073aa;
    border-color: #0073aa;
}

.ffm-captcha-refresh:focus-visible {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.ffm-captcha-refresh svg {
    display: block;
    pointer-events: none;
}

/* Spin animation during AJAX refresh */
@keyframes ffm-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ffm-captcha-refresh.ffm-spinning svg {
    animation: ffm-spin 0.6s linear infinite;
}

/* Icon buttons */
.ffm-captcha-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ffm-captcha-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px;
    background: #f9f9f9;
    color: #555;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.ffm-captcha-icon svg {
    width: 28px;
    height: 28px;
    display: block;
    pointer-events: none;
}

.ffm-captcha-icon:hover {
    border-color: #888;
    background: #f0f0f0;
    color: #333;
}

.ffm-captcha-icon:focus-visible {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.ffm-captcha-icon.ffm-selected {
    border-color: #0073aa;
    background: #e8f4fd;
    color: #0073aa;
    transform: scale(1.08);
}

/* Error message */
.ffm-captcha-error {
    display: none;
    margin-top: 8px;
    padding: 6px 10px;
    font-size: 0.875em;
    color: #dc3232;
    background: #fef1f1;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    line-height: 1.4;
}

/* Error state on wrapper */
.ffm-captcha-wrap.ffm-has-error .ffm-captcha-icons {
    border-left: 3px solid #dc3232;
    padding-left: 8px;
}

/* Honeypot – invisible to humans */
.ffm-captcha-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    .ffm-captcha-icon {
        width: 48px;
        height: 48px;
        padding: 8px;
    }

    .ffm-captcha-icon svg {
        width: 24px;
        height: 24px;
    }

    .ffm-captcha-refresh {
        width: 28px;
        height: 28px;
    }
}
