/* Enhanced Contact Form Styles */
/* Improved responsiveness, accessibility, and user experience */

/* Form container responsive improvements */
.contact-form-container {
    max-width: 100%;
    width: 100%;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.4;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    line-height: 1.5;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #fbfcfd;
}

/* Error states */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Success states */
.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: #27ae60;
    background-color: #f1f8f4;
}

/* Placeholder styling */
.form-input::placeholder,
.form-textarea::placeholder {
    color: #95a5a6;
    opacity: 1;
    font-style: italic;
}

/* Select styling */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 48px;
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233498db' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Textarea specific styling */
.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Button enhancements */
.btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-full:disabled {
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.btn-loading .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Field error messages */
.field-error {
    color: #e74c3c !important;
    font-size: 12px !important;
    margin-top: 4px !important;
    font-weight: 500 !important;
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Character counter */
.char-counter {
    font-size: 12px !important;
    color: #666 !important;
    text-align: right !important;
    margin-top: 4px !important;
    font-family: monospace;
}

/* Form message improvements */
.form-message {
    border-radius: 8px !important;
    padding: 16px !important;
    margin-top: 20px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    animation: fadeIn 0.5s ease;
}

.form-message.success {
    background-color: #d1f2eb !important;
    color: #0c5460 !important;
    border: 1px solid #7dcea0 !important;
}

.form-message.error {
    background-color: #fadbd8 !important;
    color: #922b21 !important;
    border: 1px solid #ec7063 !important;
}

.form-message.info {
    background-color: #d6eaf8 !important;
    color: #1b4f72 !important;
    border: 1px solid #85c1e9 !important;
}

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

/* Responsive improvements */
@media (max-width: 768px) {
    .contact-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .contact-info,
    .contact-form-container {
        width: 100%;
        max-width: none;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on mobile */
    }
    
    .btn-full {
        min-height: 48px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .btn-full {
        min-height: 46px;
        font-size: 14px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .form-select,
    .form-textarea,
    .btn-full {
        transition: none;
    }
    
    .field-error,
    .form-message {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input,
    .form-select,
    .form-textarea {
        border-width: 3px;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
    }
}

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading state overlay */
.form-submitting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

/* No required field indicators - all fields are optional */
.form-label::after {
    content: '';
}

/* Honeypot field (hidden from users, visible to bots) */
input[name="bot-field"] {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
}

/* Success checkmark animation */
.field-success::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    font-weight: bold;
    font-size: 16px;
}

.form-group {
    position: relative;
}

.form-input.success ~ .field-success::after,
.form-select.success ~ .field-success::after {
    display: block;
}

/* Improved mobile touch targets */
@media (max-width: 768px) {
    .btn-full {
        min-height: 48px; /* iOS recommended touch target size */
        margin-top: 1rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px; /* iOS recommended touch target size */
    }
}