/**
 * MJWTools Turnstile - Frontend Styles
 * 
 * @package MJWTools_Turnstile
 * @since 2.1.0
 */

/* ============================================
   BASE WRAPPER STYLES
   ============================================ */

.mjwt-wrapper {
    margin: 15px 0;
    clear: both;
    background: transparent !important;
    background-color: transparent !important;
}

.mjwt-widget {
    background: transparent !important;
    background-color: transparent !important;
}

.woocommerce-checkout .mjwt-wrapper,
.mjwt-block-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    background: transparent !important;
}

/* ============================================
   TRANSPARENT BACKGROUND FIX
   Forces Turnstile widget to have no background
   ============================================ */

/* Target the Cloudflare Turnstile container */
.cf-turnstile,
.cf-turnstile-wrapper,
[class*="cf-turnstile"] {
    background: transparent !important;
    background-color: transparent !important;
}

/* Target the turnstile iframe wrapper */
.cf-turnstile > div,
.cf-turnstile iframe {
    background: transparent !important;
}

/* Remove any box shadows or borders */
.cf-turnstile,
.cf-turnstile > div {
    box-shadow: none !important;
}

/* Elementor specific - field wrapper */
.elementor-field-type-mjwt_turnstile,
.elementor-field-type-mjwt_turnstile .elementor-field,
.elementor-field-type-mjwt_turnstile .elementor-field-subgroup,
.elementor-field-type-mjwt_turnstile > div {
    background: transparent !important;
    background-color: transparent !important;
}

/* Any wrapper containing turnstile */
[class*="turnstile"]:not(input):not(textarea):not(select),
[class*="mjwt"]:not(input):not(textarea):not(select) {
    background: transparent !important;
    background-color: transparent !important;
}

/* ============================================
   ERROR STATES
   ============================================ */

.mjwt-wrapper.mjwt-error,
.mjwt-widget.mjwt-error {
    padding: 10px;
    border: 2px solid #dc3545;
    border-radius: 4px;
    background: rgba(255, 245, 245, 0.9) !important;
}

.mjwt-message,
.mjwt-block-error {
    margin-top: 10px;
    padding: 8px 12px;
    color: #dc3545;
    background: rgba(255, 245, 245, 0.9);
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

/* ============================================
   PLUGIN-SPECIFIC STYLES
   ============================================ */

/* Elementor */
.elementor-form .mjwt-wrapper { 
    width: 100%; 
    background: transparent !important;
}
.elementor-field-type-mjwt_turnstile { 
    margin-bottom: 10px; 
    background: transparent !important;
}

/* Gravity Forms */
.gform_wrapper .mjwt-wrapper { 
    margin: 10px 0; 
    background: transparent !important;
}
.gform_wrapper .ginput_container_mjwt_turnstile { 
    margin-top: 8px; 
    background: transparent !important;
}

/* Contact Form 7 */
.wpcf7 .mjwt-wrapper { 
    margin: 15px 0; 
    background: transparent !important;
}
.wpcf7-mjwt-turnstile { 
    display: block; 
    background: transparent !important;
}

/* Divi */
.et_pb_contact_form .mjwt-wrapper,
.et_pb_module .mjwt-wrapper {
    background: transparent !important;
}

/* WooCommerce */
.woocommerce .mjwt-wrapper,
.woocommerce-page .mjwt-wrapper {
    background: transparent !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .mjwt-wrapper { margin: 10px 0; }
}
