/* استایل نهایی - نسخه 1.2.0 */

.sw-persian-captcha-wrapper {
    direction: rtl;
    width: 100%;
    max-width: 650px;
    margin: 0 auto 15px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 12px 16px 16px;
    border: 1px solid #edf0f7;
}

.sw-captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f6f9ff;
    padding: 8px 12px;
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid #e6ebf5;
}

.sw-digits-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-height: 70px;
    padding: 4px 6px;
    direction: ltr;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
}

.sw-digit {
    display: inline-block;
    font-size: 48px;
    font-weight: 400;
    font-family: 'Lalezar', 'Vazirmatn', 'Tahoma', cursive;
    text-shadow: 1px 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.1s;
    line-height: 1.2;
    letter-spacing: 2px;
}

.sw-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sw-speak-btn,
.sw-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #2c3e50;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #dce3ef;
}

.sw-speak-btn i,
.sw-refresh-btn i {
    color: #2c3e50;
}

.sw-speak-btn:hover,
.sw-refresh-btn:hover {
    background: #4a6cf7;
    border-color: #4a6cf7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 108, 247, 0.20);
}

.sw-speak-btn:hover i,
.sw-refresh-btn:hover i {
    color: #ffffff;
}

.sw-speak-btn:active,
.sw-refresh-btn:active {
    transform: scale(0.92);
}

.sw-input-group {
    width: 100%;
    position: relative;
}

.sw-input-group input[type="text"] {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    font-size: 22px;
    border: 2px solid #dce3ef;
    border-radius: 12px;
    background: #ffffff;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 6px;
    font-weight: 600;
    direction: ltr;
    color: #1a2639;
    font-family: 'Lalezar', 'Tahoma', sans-serif;
}

.sw-input-group input[type="text"]:focus {
    border-color: #4a6cf7;
    outline: none;
    box-shadow: 0 0 0 4px rgba(74, 108, 247, 0.08);
}

.sw-input-group input[type="text"]::placeholder {
    color: #b0bedb;
    font-weight: 300;
    letter-spacing: 1px;
    font-size: 18px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

/* آیکون اعتبارسنجی */
.sw-validation-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.sw-validation-icon.show {
    opacity: 1;
}

.sw-validation-icon.sw-valid {
    color: #27ae60;
}

.sw-validation-icon.sw-invalid {
    color: #e74c3c;
}

/* پیام‌ها */
.sw-captcha-message {
    display: none;
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    animation: swSlideDown 0.3s ease;
    direction: rtl;
    text-align: right;
}

.sw-captcha-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-right: 4px solid #4caf50;
}

.sw-captcha-error {
    background: #fce4ec;
    color: #c62828;
    border-right: 4px solid #f44336;
}

.sw-captcha-info {
    background: #e3f2fd;
    color: #0d47a1;
    border-right: 4px solid #2196f3;
}

@keyframes swSlideDown {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* حالت خطا المنتور */
.elementor-field-group .elementor-field.sw-persian-captcha-wrapper input[type="text"].elementor-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.08);
}

/* واکنش‌گرایی */
@media (max-width: 480px) {
    .sw-persian-captcha-wrapper {
        padding: 10px 12px 14px;
        max-width: 100%;
    }
    .sw-captcha-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
    }
    .sw-digits-wrapper {
        min-height: 60px;
        width: 100%;
        flex: 1 1 100%;
        order: 0;
    }
    .sw-digit {
        font-size: 40px;
    }
    .sw-toolbar {
        width: 100%;
        justify-content: center;
        order: 1;
        gap: 14px;
    }
    .sw-speak-btn,
    .sw-refresh-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .sw-input-group input[type="text"] {
        height: 52px;
        font-size: 24px;
        letter-spacing: 8px;
    }
}

@media (min-width: 481px) {
    .sw-captcha-row {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    .sw-digits-wrapper {
        flex: 1;
        min-height: 70px;
    }
    .sw-toolbar {
        flex-shrink: 0;
        justify-content: flex-end;
    }
}

@media (min-width: 769px) {
    .sw-persian-captcha-wrapper {
        padding: 14px 20px 18px;
    }
    .sw-digit {
        font-size: 54px;
    }
    .sw-speak-btn,
    .sw-refresh-btn {
        width: 44px;
        height: 44px;
    }
}