/**
 * Bridge MLS Leads Frontend Styles
 * 
 * @package Bridge_MLS_Professional
 * @since 4.0.0
 */

/* Lead Form Wrapper */
.bmls-lead-form-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.bmls-form-title {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Property Inquiry Specific */
.bmls-property-inquiry-form-wrapper .bmls-property-summary {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
}

.bmls-property-summary h4 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.bmls-property-summary .property-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #27ae60;
    margin: 0.5rem 0;
}

.bmls-property-summary .property-details {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* Form Layout */
.bmls-lead-form {
    max-width: 600px;
}

.bmls-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bmls-form-field {
    margin-bottom: 1rem;
}

.bmls-form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.bmls-form-field .required {
    color: #e74c3c;
    margin-left: 0.25rem;
}

/* Form Inputs */
.bmls-form-field input[type="text"],
.bmls-form-field input[type="email"],
.bmls-form-field input[type="tel"],
.bmls-form-field input[type="number"],
.bmls-form-field select,
.bmls-form-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.bmls-form-field input:focus,
.bmls-form-field select:focus,
.bmls-form-field textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.bmls-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Select Styling */
.bmls-form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    appearance: none;
}

/* Checkbox Styling */
.bmls-form-field input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.bmls-form-field label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Submit Button */
.bmls-submit-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    position: relative;
    min-width: 140px;
}

.bmls-submit-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.bmls-submit-button:active {
    transform: translateY(0);
}

.bmls-submit-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.bmls-submit-button .button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bmls-submit-button .button-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: bmls-spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes bmls-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Messages */
.bmls-form-messages {
    margin-top: 1rem;
}

.bmls-success-message,
.bmls-error-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.bmls-success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bmls-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Field Validation */
.bmls-field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.field-error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Required Field Indicator */
.bmls-required-field:invalid {
    border-color: #e74c3c;
}

.bmls-required-field:valid {
    border-color: #27ae60;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bmls-lead-form-wrapper {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .bmls-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .bmls-form-title {
        font-size: 1.3rem;
    }
    
    .bmls-property-summary {
        padding: 1rem;
    }
    
    .bmls-property-summary .property-price {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .bmls-lead-form-wrapper {
        padding: 1rem;
        border-radius: 4px;
    }
    
    .bmls-form-field input,
    .bmls-form-field select,
    .bmls-form-field textarea {
        padding: 0.625rem;
    }
    
    .bmls-submit-button {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
}

/* Print Styles */
@media print {
    .bmls-lead-form-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .bmls-submit-button {
        display: none;
    }
    
    .bmls-form-messages {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bmls-form-field input,
    .bmls-form-field select,
    .bmls-form-field textarea {
        border-width: 2px;
        border-color: #000;
    }
    
    .bmls-submit-button {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bmls-form-field input,
    .bmls-form-field select,
    .bmls-form-field textarea,
    .bmls-submit-button {
        transition: none;
    }
    
    .bmls-submit-button .button-loading::before {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bmls-lead-form-wrapper {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .bmls-form-title {
        color: #ecf0f1;
    }
    
    .bmls-property-summary {
        background: #34495e;
        color: #ecf0f1;
    }
    
    .bmls-property-summary h4 {
        color: #ecf0f1;
    }
    
    .bmls-form-field label {
        color: #ecf0f1;
    }
    
    .bmls-form-field input,
    .bmls-form-field select,
    .bmls-form-field textarea {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .bmls-form-field input:focus,
    .bmls-form-field select:focus,
    .bmls-form-field textarea:focus {
        border-color: #3498db;
    }
}

/* Focus Indicators for Accessibility */
.bmls-form-field input:focus-visible,
.bmls-form-field select:focus-visible,
.bmls-form-field textarea:focus-visible,
.bmls-submit-button:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading State */
.bmls-lead-form.submitting {
    opacity: 0.7;
    pointer-events: none;
}

.bmls-lead-form.submitting .bmls-submit-button {
    background: #bdc3c7;
}