/* Form Enhancements CSS for Radon LLC */

/* Phone Input Container Styling */
.phone-input-container {
    position: relative;
    width: 100%;
}

.phone-input-container .iti {
    width: 100%;
}

.phone-input-container .iti__flag-container {
    z-index: 1000;
}

/* Error Message Styling */
.error-message {
    color: #dc3545 !important;
    font-size: 14px !important;
    margin-top: 5px !important;
    margin-bottom: 10px !important;
    display: block !important;
    font-weight: normal !important;
}

/* Form Field Error State */
input.error, 
textarea.error, 
select.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Success State */
input.valid, 
textarea.valid, 
select.valid {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* reCAPTCHA Container */
.g-recaptcha {
    margin: 15px 0;
}

/* Alert Styling */
.alert {
    border-radius: 5px;
    margin-bottom: 20px;
    padding: 15px;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-danger ul {
    margin: 0;
    padding-left: 20px;
}

.alert-danger li {
    margin-bottom: 5px;
}

/* Form Enhancement Specific Styling */
.form-groups {
    margin-bottom: 15px;
}

.form-groups input[type="checkbox"] {
    margin-right: 8px;
}

.form-groups label {
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

/* International Phone Input Overrides */
.iti__country-list {
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    border-radius: 4px;
}

.iti__selected-flag {
    padding: 0 10px 0 8px;
}

.iti__arrow {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #555;
}

/* Enhanced Country Search Functionality */
.iti__search-container {
    padding: 8px;
    border-bottom: 1px solid #ccc;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.iti__search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.iti__search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.iti__search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Improve country dropdown styling */
.iti__country {
    padding: 8px 12px;
    transition: background-color 0.2s ease;
}

.iti__country:hover {
    background-color: #f8f9fa;
}

.iti__country.iti__highlight {
    background-color: #007bff;
    color: white;
}

/* Loading state for country detection */
.country-detecting {
    position: relative;
}

.country-detecting::after {
    content: "Detecting your country...";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 4px 8px;
    background: #007bff;
    color: white;
    font-size: 12px;
    text-align: center;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .phone-input-container {
        margin-bottom: 15px;
    }
    
    .iti__flag-container {
        right: auto;
        left: 0;
    }
    
    .error-message {
        font-size: 12px !important;
    }
}

/* Loading State for reCAPTCHA */
.g-recaptcha iframe {
    border-radius: 4px;
}

/* Honeypot Field (Hidden) */
input[name="honeypot"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Form Submission States */
.form-submitting {
    pointer-events: none;
    opacity: 0.7;
}

.form-submitting input[type="submit"] {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed !important;
}

/* Improved File Upload Styling */
.custom-drop-file {
    position: relative;
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.custom-drop-file:hover {
    border-color: #007bff;
}

.custom-drop-file input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.custom-drop-file p {
    margin: 0;
    color: #666;
}

.custom-drop-file span {
    color: #007bff;
    font-weight: bold;
}

/* Form Loading Overlay */
.form-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border-radius: 4px;
}

.form-loading-spinner {
    text-align: center;
    color: #333;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-loading-spinner p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #666;
}

/* Form Submit Button States */
input[type="submit"]:disabled,
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #6c757d !important;
}

/* Form Field Focus States */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Warning State for Real-time Validation */
.validation-warning {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .phone-input-container .iti__country-list {
        max-height: 250px;
    }
    
    .phone-input-container input[type="tel"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .iti__search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .form-loading-spinner {
        padding: 20px;
    }
    
    .spinner {
        width: 35px;
        height: 35px;
    }
    
    .form-loading-spinner p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .error-message {
        font-size: 12px !important;
    }
    
    .phone-input-container .iti__country-list {
        font-size: 14px;
    }
} 