/**
 * WPSite Privacy Consent CSS
 * Styles for the privacy consent checkbox
 */

/* Privacy Consent Checkbox Container */
.elementor-field-group-privacy-consent {
    margin-bottom: 20px;
    position: relative;
}

/* For horizontal forms - checkbox appears below the form 
   Horizontal forms have fields and submit button on the same row,
   so the checkbox needs to be placed below to avoid visual conflicts */
.elementor-form .elementor-field-group-privacy-consent:last-child,
.elementor-form .elementor-field-group-privacy-consent.privacy-consent-horizontal {
    margin-top: 8px;
    margin-bottom: 0;
    clear: both;
    width: 100% !important;
    padding-top: 8px;
}

/* Checkbox Label */
.elementor-field-group-privacy-consent .elementor-field-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
    padding: 0;
}

/* Checkbox Input */
.elementor-field-group-privacy-consent .elementor-field-checkbox {
    margin: 0 8px 0 0;
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    border: 2px solid #d5d8dc;
    border-radius: 3px;
    background-color: #fff;
    transition: all 0.3s ease;
}

/* Checkbox Input Focus */
.elementor-field-group-privacy-consent .elementor-field-checkbox:focus {
    outline: none;
    border-color: #61ce70;
    box-shadow: 0 0 0 2px rgba(97, 206, 112, 0.2);
}

/* Checkbox Input Checked */
.elementor-field-group-privacy-consent .elementor-field-checkbox:checked {
    background-color: #61ce70;
    border-color: #61ce70;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Checkbox Text */
.elementor-field-group-privacy-consent .elementor-field-checkbox-text {
    flex: 1;
    color: inherit;
    line-height: 1.5;
}

/* Ensure text color matches other form labels */
.elementor-field-group-privacy-consent .elementor-field-checkbox-text {
    color: var(--e-form-field-label-color, #6d7882);
}

/* Support for Elementor custom colors */
.elementor-form .elementor-field-group-privacy-consent .elementor-field-checkbox-text {
    color: inherit;
}

/* Privacy Policy Link */
.elementor-field-group-privacy-consent .elementor-field-checkbox-text a {
    color: inherit;
    text-decoration: underline;
    transition: text-decoration 0.3s ease;
}

.elementor-field-group-privacy-consent .elementor-field-checkbox-text a:hover {
    text-decoration: none;
}

/* Error State */
.elementor-field-group-privacy-consent .elementor-field-checkbox.elementor-field-error {
    border-color: #d9534f;
    background-color: #fff;
}

.elementor-field-group-privacy-consent .elementor-field-checkbox.elementor-field-error:checked {
    background-color: #d9534f;
    border-color: #d9534f;
}

/* Error Message */
.elementor-field-group-privacy-consent .elementor-field-validation-error {
    margin-top: 8px;
    color: #d9534f;
    font-size: 12px;
    line-height: 1.4;
}

.elementor-field-group-privacy-consent .elementor-field-validation-error .elementor-form-help-inline-error {
    color: #d9534f;
}

/* Focus State */
.elementor-field-group-privacy-consent.elementor-field-group-focus .elementor-field-checkbox {
    border-color: #61ce70;
}

/* Hover State */
.elementor-field-group-privacy-consent .elementor-field-checkbox:hover {
    border-color: #61ce70;
}

/* RTL Support - Hebrew text with checkbox on the right */
body.rtl .elementor-field-group-privacy-consent .elementor-field-label,
[dir="rtl"] .elementor-field-group-privacy-consent .elementor-field-label,
.elementor-field-group-privacy-consent[dir="rtl"] .elementor-field-label {
    direction: rtl;
    text-align: right;
    /* Keep normal flex direction so checkbox stays on the right */
    flex-direction: row;
}

body.rtl .elementor-field-group-privacy-consent .elementor-field-checkbox,
[dir="rtl"] .elementor-field-group-privacy-consent .elementor-field-checkbox,
.elementor-field-group-privacy-consent[dir="rtl"] .elementor-field-checkbox {
    /* In RTL, checkbox should be on the left side of text */
    margin: 0 0 0 8px;
    margin-top: 2px;
}



/* Responsive Design */
@media (max-width: 767px) {
    .elementor-field-group-privacy-consent .elementor-field-label {
        font-size: 13px;
    }
    
    .elementor-field-group-privacy-consent .elementor-field-checkbox {
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }
    
    /* On mobile, ensure horizontal forms' checkbox is clearly separated but closer */
    .elementor-form .elementor-field-group-privacy-consent.privacy-consent-horizontal {
        margin-top: 12px;
        padding-top: 10px;
        border-top-width: 2px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .elementor-field-group-privacy-consent .elementor-field-checkbox {
        background-color: #2a2a2a;
        border-color: #555;
    }
    
    .elementor-field-group-privacy-consent .elementor-field-checkbox-text {
        color: inherit;
    }
    
    .elementor-field-group-privacy-consent .elementor-field-checkbox:focus {
        border-color: #61ce70;
        box-shadow: 0 0 0 2px rgba(97, 206, 112, 0.3);
    }
    

}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .elementor-field-group-privacy-consent .elementor-field-checkbox {
        border-width: 3px;
    }
    
    .elementor-field-group-privacy-consent .elementor-field-checkbox:checked {
        background-color: #000;
        border-color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .elementor-field-group-privacy-consent .elementor-field-checkbox {
        transition: none;
    }
    
    .elementor-field-group-privacy-consent .elementor-field-checkbox-text a {
        transition: none;
    }
}
