/* Contact Form Validation Styles */

/* Form validation feedback styles */
.input-box input.is-valid,
.input-box textarea.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.8-.77-.8-.77-.8.77.8.77zm1.48-4.97L6.06 4.3 5.28 5.07l-1.48-2.54-.8.77L5.28 6.84l.78-.77 2.54-4.24-.8-.77z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.input-box input.is-invalid,
.input-box textarea.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 2.4 2.4m0-2.4L5.8 7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Invalid feedback styling */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.input-box input.is-invalid ~ .invalid-feedback,
.input-box textarea.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Input box states */
.input-box.has-success {
    position: relative;
}

.input-box.has-error {
    position: relative;
}

.input-box.has-success::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-color: #28a745;
    border-radius: 50%;
    opacity: 0.8;
}

.input-box.has-error::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-color: #dc3545;
    border-radius: 50%;
    opacity: 0.8;
}

/* Alert styling improvements */
.alert {
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 15px 20px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin-bottom: 5px;
}

.alert li:last-child {
    margin-bottom: 0;
}

/* Button styling improvements */
.btn-one {
    background: var(--secondary-color) !important;
    color: #ffffff !important;
    border: 2px solid var(--secondary-color) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-one:hover,
.btn-one:focus {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* Button loading state */
button[type="submit"]:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    background: #6c757d !important;
    border-color: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

button[type="submit"].loading {
    position: relative;
    color: transparent !important;
}

button[type="submit"].loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form focus improvements */
.input-box input:focus,
.input-box textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .input-box input.is-valid,
    .input-box textarea.is-valid,
    .input-box input.is-invalid,
    .input-box textarea.is-invalid {
        background-size: calc(0.65em + 0.325rem) calc(0.65em + 0.325rem);
        background-position: right calc(0.325em + 0.1625rem) center;
    }

    .alert {
        padding: 12px 15px;
        font-size: 0.9em;
    }
}

/* Animation for validation feedback */
.input-box input,
.input-box textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.invalid-feedback {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CAPTCHA field specific styling */
input[name="captcha"] {
    font-weight: 500;
}

input[name="captcha"]::placeholder {
    font-weight: normal;
    color: #6c757d;
}

/* Form section styling for home page */
.contact-form-area .sec-title h2 {
    color: #333;
    margin-bottom: 40px;
}

.contact-form-area .sec-title .sub-title h3 {
    color: #007bff;
    margin-bottom: 10px;
}
