/* CEV Custom Forms - Frontend Styles */

.cev-contact-form-container,
.cev-booking-form-container,
.cev-custom-request-form-container,
.cev-intake-form-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.cev-form-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cev-form-note {
    color: #666;
    font-size: 14px;
    margin: 0 0 25px 0;
    text-align: center;
    font-style: italic;
}

.cev-contact-form,
.cev-booking-form,
.cev-custom-request-form,
.cev-intake-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cev-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cev-form-group select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff !important;
    cursor: pointer;
}

.cev-form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cev-form-group {
    display: flex;
    flex-direction: column;
}

.cev-form-group label {
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.cev-form-group input,
.cev-form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff !important;
}

.cev-form-group input:focus,
.cev-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cev-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.cev-checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.cev-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.cev-checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #e1e5e9;
    border-radius: 3px;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.cev-checkbox-label input[type="checkbox"]:checked {
    background-color: #007cba !important;
    border-color: #007cba !important;
    background-image: none !important;
}

.cev-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}


/* Force full blue background for checked state */

.cev-checkbox-label input[type="checkbox"]:checked {
    background: #007cba !important;
    background-color: #007cba !important;
    background-image: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}


/* Additional browser-specific overrides */

.cev-checkbox-label input[type="checkbox"]:checked::-webkit-checkbox {
    background-color: #007cba !important;
}

.cev-checkbox-label input[type="checkbox"]:checked::-moz-checkbox {
    background-color: #007cba !important;
}


/* Ensure the checkmark is visible */

.cev-checkbox-label input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #007cba;
    border-radius: 3px;
    z-index: 0;
}

.cev-checkbox-label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cev-checkbox-text {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.cev-submit-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    align-self: center;
    min-width: 150px;
}

.cev-submit-btn:hover {
    background-color: #555;
    transform: translateY(-2px);
}

.cev-submit-btn:active {
    transform: translateY(0);
}

.cev-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.cev-form-message {
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    margin-top: 15px;
}

.cev-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cev-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Loading state */

.cev-form-loading .cev-submit-btn {
    position: relative;
    color: transparent;
}

.cev-form-loading .cev-submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: cev-spin 1s linear infinite;
}

@keyframes cev-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}


/* Responsive Design */

@media (max-width: 768px) {
    .cev-contact-form-container,
    .cev-booking-form-container,
    .cev-custom-request-form-container,
    .cev-intake-form-container {
        margin: 10px;
        padding: 15px;
    }
    .cev-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .cev-form-title {
        font-size: 20px;
    }
    .cev-form-group input,
    .cev-form-group textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
    .cev-submit-btn {
        width: 100%;
        padding: 18px 30px;
    }
    .cev-checkbox-group {
        flex-direction: column;
        gap: 8px;
    }
    .cev-checkbox-label {
        align-items: flex-start;
    }
    .cev-checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .cev-contact-form-container,
    .cev-booking-form-container,
    .cev-custom-request-form-container,
    .cev-intake-form-container {
        margin: 5px;
        padding: 12px;
    }
    .cev-form-title {
        font-size: 18px;
    }
    .cev-form-note {
        font-size: 13px;
    }
    .cev-checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }
}


/* High contrast mode support */

@media (prefers-contrast: high) {
    .cev-contact-form-container {
        border: 2px solid #000;
    }
    .cev-form-group input,
    .cev-form-group textarea {
        border-color: #000;
    }
    .cev-submit-btn {
        border: 2px solid #000;
    }
}


/* Reduced motion support */

@media (prefers-reduced-motion: reduce) {
    .cev-form-group input,
    .cev-form-group textarea,
    .cev-submit-btn {
        transition: none;
    }
    .cev-submit-btn:hover {
        transform: none;
    }
    @keyframes cev-spin {
        0% {
            transform: translate(-50%, -50%) rotate(0deg);
        }
        100% {
            transform: translate(-50%, -50%) rotate(0deg);
        }
    }
}