/**
 * CPM Forms Plugin Styles
 * Version: 1.0.0
 */

/* Form Container */
.cpm-form-container {
    max-width: 600px;
    margin: 0px auto;
    padding: 0px;
    background: #ffffff;
    font-family: inherit;
}

.cpm-form-container.contact-sales-form{
    max-width: none;
}

/* Form Status Messages */
.cpm-form-status {
    text-align: center;
    padding: 15px;
    margin-bottom: 50px;
    border-radius: 4px;
    font-weight: 500;
    display: none;
}

.cpm-form-status.submitting {
    background-color: #f8f9fa;
    border: none;
    color: #219ebc;
    display: block;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cpm-form-status.success {
    background-color: #f8f9fa;
    border: none;
    border-left: 4px solid #28a745;
    color: #333;
    display: block;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cpm-form-status.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

/* Form Styling */
.cpm-form { 
    width: 100%;
}

/* Form Fields */
.cpm-form-field {
    margin-bottom: 40px;
    position: relative;
}

.cpm-form-field.full-width {
    width: 100%;
}

/* Form Rows for side-by-side fields */
.cpm-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.cpm-form-field-half {
    flex: 1;
    margin-bottom: 0;
}


/* Floating Labels */
.cpm-form-field label {
    font-weight: 400;
    color: #666;
    font-size: 16px;
    position: absolute;
    top: 12px;
    left: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* Input Fields - Underlined Style */
.cpm-form-field input[type="text"],
.cpm-form-field input[type="email"],
.cpm-form-field input[type="tel"],
.cpm-form-field textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #000000;
    background: transparent;
    font-size: 16px;
    transition: border-bottom-color 0.3s ease;
    box-sizing: border-box;
    outline: none;
    max-width: none;
}

/* Label animation on focus or when input has content */
.cpm-form-field input[type="text"]:focus + label,
.cpm-form-field input[type="email"]:focus + label,
.cpm-form-field input[type="tel"]:focus + label,
.cpm-form-field input[type="text"]:not(:placeholder-shown) + label,
.cpm-form-field input[type="email"]:not(:placeholder-shown) + label,
.cpm-form-field input[type="tel"]:not(:placeholder-shown) + label,
.cpm-form-field textarea:focus + label,
.cpm-form-field textarea:not(:placeholder-shown) + label {
    top: -20px;
    font-family: inherit;
    font-weight: 700;
}

.cpm-form-field input[type="text"]:focus,
.cpm-form-field input[type="email"]:focus,
.cpm-form-field input[type="tel"]:focus,
.cpm-form-field textarea:focus {
    border-bottom-color: #333;
}

/* Textarea Specific */
.cpm-form-field textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Radio Button Group for Preferred Contact Method */
.cpm-form-field .radio-group-label {
    position: static !important;
    top: auto !important;
    font-size: 16px !important;
    color: #333 !important;
    margin-bottom: 15px !important;
    display: block !important;
    pointer-events: auto !important;
}

.radio-group {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    border-radius: 50%;
    appearance: none;
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s ease;
}

.radio-option input[type="radio"]:checked {
    border-color: #333;
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-option label {
    margin: 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    position: static !important;
    top: auto !important;
    color: #333 !important;
}

/* Submit Button */
.elementor-kit-455 input[type="submit"].cpm-form-submit,
input[type="submit"].cpm-form-submit {
    background: #132656;
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    min-width: 120px;
    display: block;
    margin-left: auto;
}

.elementor-kit-455 input[type="submit"].cpm-form-submit:hover,
input[type="submit"].cpm-form-submit:hover {
    background: #132656;
    opacity: 0.7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(60, 75, 92, 0.3);
}

.elementor-kit-455 input[type="submit"].cpm-form-submit:active,
input[type="submit"].cpm-form-submit:active {
    transform: translateY(0);
}

/* Error Message */
.cpm-form-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cpm-form-container {
        margin: 10px;
        padding: 20px;
    }
    
    .cpm-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cpm-form-field-half {
        margin-bottom: 40px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .elementor-kit-455 input[type="submit"].cpm-form-submit,
    .cpm-form-submit {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .cpm-form-container {
        margin: 5px;
        padding: 15px;
    }
    
    .cpm-form-field input[type="text"],
    .cpm-form-field input[type="email"],
    .cpm-form-field input[type="tel"],
    .cpm-form-field select,
    .cpm-form-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Required Field Indicator */
.cpm-form-field label::after {
    content: "";
}

.cpm-form-field input[required]:not([type="radio"]):not([type="checkbox"]) + label::after,
.cpm-form-field select[required] + label::after {
    content: " *";
}

/* Form Disabled State */
.cpm-form.submitting {
    opacity: 0.6;
    pointer-events: none;
}

.cpm-form.submitting input,
.cpm-form.submitting textarea,
.cpm-form.submitting select {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.cpm-form.submitting .cpm-form-submit {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Submitted State */
.cpm-form.submitted {
    opacity: 0.7;
    pointer-events: none;
}

.cpm-form.submitted input,
.cpm-form.submitted textarea,
.cpm-form.submitted select {
    background-color: #f8f9fa;
    cursor: default;
}

.cpm-form.submitted .cpm-form-submit {
    display: none;
}

/* Loading Animation */
.cpm-form-status.submitting::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 15px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
