/**
 * FT Contact - Extreme Specificity Frontend Stylesheet
 */

html body .ftc-contact-container {
    --ftc-primary: #3b82f6;
    --ftc-surface: #ffffff;
    --ftc-text-title: #0f172a;
    --ftc-text-body: #334155;
    --ftc-text-muted: #64748b;
    --ftc-border: #cbd5e1;
    --ftc-status-error: #ef4444;
    --ftc-status-success: #10b981;
    --ftc-radius: 8px;

    width: 100% !important;
    max-width: 640px !important;
    box-sizing: border-box !important;
    font-family: inherit;
    direction: rtl !important;
    text-align: right !important;
    position: relative;
}

html body .ftc-contact-container *,
html body .ftc-contact-container *::before,
html body .ftc-contact-container *::after {
    box-sizing: border-box !important;
}

html body .ftc-contact-container p,
html body .ftc-contact-container br {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
}

html body .ftc-contact-container .ftc-form {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .ftc-hidden-trap {
    position: absolute !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
}

html body .ftc-contact-container .ftc-form-row {
    display: block !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    clear: both;
}

html body .ftc-contact-container .ftc-form-row:last-of-type {
    margin-bottom: 20px !important;
}

html body .ftc-contact-container .ftc-form-row.ftc-grid-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
}

@media (max-width: 600px) {
    html body .ftc-contact-container .ftc-form-row.ftc-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

html body .ftc-contact-container .ftc-field-wrapper {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .ftc-contact-container .ftc-control-wrapper {
    width: 100% !important;
}

html body .ftc-contact-container .ftc-field-label {
    display: block !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--ftc-text-body) !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.4 !important;
}

html body .ftc-contact-container .ftc-field-asterisk {
    color: var(--ftc-status-error) !important;
    margin-right: 2px !important;
}

/* ورودی عمومی */
html body .ftc-contact-container input.ftc-input-element,
html body .ftc-contact-container select.ftc-input-element,
html body .ftc-contact-container textarea.ftc-input-element {
    display: block !important;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: var(--ftc-text-title) !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

html body .ftc-contact-container textarea.ftc-input-element {
    min-height: 110px !important;
    height: auto !important;
    resize: vertical !important;
    padding: 10px 14px !important;
}

html body .ftc-contact-container select.ftc-select-element {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    background-size: 16px !important;
    padding-left: 36px !important;
    cursor: pointer !important;
}

html body .ftc-contact-container .ftc-field-error {
    color: var(--ftc-status-error) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin: 4px 0 0 0 !important;
    line-height: 1.4 !important;
}
html body .ftc-contact-container .ftc-field-error:empty { display: none !important; }

/* دکمه ارسال با اولویت نهایی */
html body .ftc-contact-container .ftc-submit-row {
    margin: 14px 0 0 0 !important;
}

html body .ftc-contact-container .ftc-button-submit,
html body .ftc-contact-container button[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

html body .ftc-contact-container .ftc-button-submit:hover,
html body .ftc-contact-container button[type="submit"]:hover {
    filter: brightness(0.9) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}

html body .ftc-contact-container .ftc-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    margin-left: 8px;
    animation: ftc-spin 0.7s linear infinite;
}

html body .ftc-contact-container .ftc-button-submit.is-loading .ftc-btn-spinner {
    display: inline-block !important;
}

@keyframes ftc-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   ویجت سوال امنیتی فشرده و استاندارد (جلوگیری قطعی از تمام‌عرض شدن)
   ========================================================================== */
html body .ftc-contact-container .ftc-captcha-box {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    max-width: 100% !important;
    background: #f8fafc !important;
    border: 1.5px solid var(--ftc-border) !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
}

html body .ftc-contact-container .ftc-captcha-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    direction: ltr !important;
    user-select: none !important;
    padding: 4px 10px !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    height: 38px !important;
}

html body .ftc-contact-container .ftc-captcha-badge .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    color: var(--ftc-primary) !important;
}

/* کادر پاسخ سوال عددی - با عرض ثابت و غیرقابل کشیده شدن */
html body .ftc-contact-container input.ftc-captcha-input {
    display: inline-block !important;
    width: 85px !important;
    min-width: 80px !important;
    max-width: 90px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 4px 8px !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    border: 1.5px solid var(--ftc-border) !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
}

html body .ftc-contact-container .ftc-btn-refresh-captcha {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 1px solid var(--ftc-border) !important;
    border-radius: 8px !important;
    color: var(--ftc-text-body) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
}

html body .ftc-contact-container .ftc-btn-refresh-captcha:hover {
    background: #f1f5f9 !important;
    color: var(--ftc-primary) !important;
}

html body .ftc-contact-container .ftc-btn-refresh-captcha .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

/* ==========================================================================
   استایل‌های کانتینر در هر ۵ پریست
   ========================================================================== */
html body .ftc-contact-container.ftc-style-modern {
    background: #ffffff !important;
    padding: 28px !important;
    border-radius: 14px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08) !important;
}

html body .ftc-contact-container.ftc-style-minimal {
    background: transparent !important;
    padding: 8px 0 !important;
    border: none !important;
    box-shadow: none !important;
}

html body .ftc-contact-container.ftc-style-filled {
    background: #ffffff !important;
    padding: 26px !important;
    border-radius: 16px !important;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

html body .ftc-contact-container.ftc-style-glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    padding: 32px !important;
    border-radius: 20px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08) !important;
}

html body .ftc-contact-container.ftc-style-rounded {
    background: #ffffff !important;
    padding: 30px !important;
    border-radius: 28px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
}