/**
 * Contact Form Styles
 * Enhanced styling for the contact form with validation states and UX improvements
 */

/* Form Messages */
.form-messages {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 4px;
    animation: slideDown 0.3s ease-out;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-messages {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.error-messages ul {
    margin: 0;
    padding-left: 1.2rem;
}

.error-messages li {
    margin-bottom: 0.5rem;
}

/* Field Validation States */
.field input.valid,
.field textarea.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.field input.error,
.field textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Field Error Messages */
.field-error {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
}

/* Character Counter */
.char-counter {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Loading Spinner */
.loading-spinner {
    color: #666;
    font-style: italic;
    margin-left: 1rem;
}

/* Form Submitting State */
.form.submitting {
    opacity: 0.7;
    pointer-events: none;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-messages {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .char-counter {
        text-align: left;
    }
}

/* Focus States for Better Accessibility */
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Honeypot Field (Hidden) */
input[name="website"] {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Success State Animation */
.success-message {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Button States */
.button.primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Field Focus Enhancement */
.field {
    position: relative;
}

.field input:focus + .field-error,
.field textarea:focus + .field-error {
    color: #007bff;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .loading-spinner {
        display: block;
        margin-left: 0;
        margin-top: 0.5rem;
        text-align: center;
    }
    
    .actions li {
        text-align: center;
    }
}
