/**
 * Contact Form Styles for Lines Engineering
 * Enhanced styling for form validation, feedback, and user experience
 */

/* Form validation states */
.form-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    width: 100%;
    font-size: 16px;
    background-color: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    background-color: #ffffff;
}

.form-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* Error messages */
.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease;
}

.error-message::before {
    content: "⚠";
    margin-right: 4px;
    font-size: 12px;
}

/* Success and error alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-success::before {
    content: "✓";
    font-weight: bold;
    margin-right: 8px;
    color: #10b981;
    font-size: 18px;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.alert-error::before {
    content: "✕";
    font-weight: bold;
    margin-right: 8px;
    color: #ef4444;
    font-size: 18px;
}

/* Loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Spinner animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Character counter */
.character-counter {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.character-counter.warning {
    color: #f59e0b;
}

.character-counter.danger {
    color: #ef4444;
}

/* Honeypot field (hidden) */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    tab-index: -1 !important;
}

/* Form field focus indicators */
.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.form-field:focus-within .form-label {
    color: #1e40af;
}

/* Required field indicators */
.required::after {
    content: " *";
    color: #ef4444;
    font-weight: bold;
}

/* Submit button enhancements */
.submit-btn {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    border: none;
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.2);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .form-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
    }
    
    .form-input:focus {
        border-width: 3px;
    }
    
    .alert {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .submit-btn,
    .alert,
    .error-message {
        transition: none;
        animation: none;
    }
}

/* Print styles */
@media print {
    .submit-btn,
    .alert,
    .error-message {
        display: none;
    }
    
    .form-input {
        border: 1px solid #000;
        background: transparent;
    }
}
