.iranian-captcha-container {
    margin: 12px 0;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.iranian-captcha-container label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}

.captcha-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    margin: 8px 0;
    width: 100%;
    box-sizing: border-box;
}

.captcha-image {
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f5f5f5;
    height: 45px;
    width: auto;
    max-width: 130px;
    flex: 1 1 auto;
    object-fit: contain;
    display: block;
}

.captcha-refresh {
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    transition: background 0.2s;
}

.captcha-refresh:hover { background: #005a87; }
.captcha-refresh:disabled { opacity: 0.5; cursor: not-allowed; }

input[name="iranian_captcha_input"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 16px;
    font-family: inherit;
    letter-spacing: 4px;
    text-align: center;
    box-sizing: border-box;
    margin: 0;
}

input[name="iranian_captcha_input"]:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 186, 0.3);
}

.login form .iranian-captcha-container { margin: 8px 0 12px; padding: 8px; }
.login form .captcha-image { height: 40px; max-width: 120px; }
.login form .captcha-refresh {
    width: 32px; height: 32px; min-width: 32px; min-height: 32px; flex: 0 0 32px;
}

@media (prefers-color-scheme: dark) {
    .iranian-captcha-container { background: #2c2c2c; border-color: #444; }
    .iranian-captcha-container label { color: #ccc; }
    input[name="iranian_captcha_input"] {
        background: #1e1e1e; border-color: #555; color: #eee;
    }
}

@media (max-width: 480px) {
    .captcha-wrapper { flex-wrap: wrap; }
    .captcha-image { max-width: 100%; flex: 1 1 100%; margin-bottom: 5px; }
    .captcha-refresh {
        flex: 1 1 auto; width: auto; min-width: 40px; height: 36px;
    }
}