/* Contact Form & FAQ Styles - Accessible and Professional */

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for better accessibility */
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.radio-option:has(input:focus-visible),
.checkbox-group:has(input:focus-visible) {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-group input,
    .form-group textarea,
    .form-group select,
    .radio-option,
    .checkbox-group {
        border-width: 3px;
    }
    
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        box-shadow: 0 0 0 4px rgba(0, 134, 105, 0.3);
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS
======================================== */
@media (max-width: 767px) {
    .contact-form {
        padding: 1.5rem;
        margin: 0 0.5rem;
        border-radius: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.75rem;
        font-size: 1rem; /* Prevent zoom on iOS */
    }
    
    .radio-option,
    .checkbox-group {
        padding: 0.875rem;
    }
    
    .faq-question {
        padding: 1rem;
        font-size: 0.9375rem;
    }
    
    .faq-answer p {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .form-success {
        padding: 2rem 1.5rem;
        margin: 0 0.5rem;
    }
    
    .success-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .form-success h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .form-success p {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }
}

/* ========================================
   SMALL MOBILE DEVICES
======================================== */
@media (max-width: 480px) {
    .contact-form-container {
        padding: 0 0.5rem;
    }
    
    .contact-form {
        padding: 1.25rem;
        margin: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .radio-group {
        gap: 0.5rem;
    }
    
    .radio-option,
    .checkbox-group {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .radio-option label,
    .checkbox-group label {
        font-size: 0.8125rem;
    }
    
    .faq-container {
        padding: 0 0.5rem;
    }
    
    .faq-question {
        padding: 0.875rem;
        font-size: 0.875rem;
        gap: 0.75rem;
    }
    
    .faq-answer p {
        padding: 0.875rem;
        font-size: 0.8125rem;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
======================================== */
@media (prefers-reduced-motion: reduce) {
    .form-group input,
    .form-group textarea,
    .form-group select,
    .radio-option,
    .checkbox-group,
    .faq-question,
    .faq-answer,
    .faq-question i {
        transition: none;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .form-success,
    .contact-form {
        box-shadow: none;
        border: 2px solid #000;
    }
    
    .form-group input,
    .form-group textarea {
        border: 1px solid #000;
        background: white;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid #000;
        background: white;
        color: #000;
    }
    
    .faq-answer {
        max-height: none !important;
        opacity: 1 !important;
    }
}

/* ========================================
   DARK MODE ENHANCEMENTS
======================================== */
@media (prefers-color-scheme: dark) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .radio-option,
    .checkbox-group {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .radio-option:hover,
    .checkbox-group:hover {
        background: rgba(0, 134, 105, 0.15);
    }
    
    .radio-option:has(input:checked),
    .checkbox-group:has(input:checked) {
        background: rgba(0, 134, 105, 0.2);
    }
    
    .faq-question:hover {
        background: rgba(0, 134, 105, 0.15);
    }
    
    .form-error-alert {
        background: rgba(239, 68, 68, 0.2);
        border-color: var(--error-color);
    }
}

/* ========================================
   LOADING ANIMATIONS
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-success,
.form-error-alert {
    animation: fadeIn 0.4s ease-out;
}

/* ========================================
   CUSTOM FORM ELEMENTS
======================================== */
/* Custom radio button styling for better accessibility */
.radio-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-primary);
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-option input[type="radio"]:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Custom checkbox styling */
.checkbox-group input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.checkbox-group input[type="checkbox"]:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ========================================
   ENHANCED FORM VALIDATION STYLES
======================================== */
.form-group.success input,
.form-group.success textarea {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group.success::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.125rem;
}

/* ========================================
   TOOLTIP STYLES (FOR FUTURE USE)
======================================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.tooltip:hover::after,
.tooltip:focus::after {
    opacity: 1;
    visibility: visible;
}
/*================================
   CONTACT FORM CONTAINER
======================================== */
.contact-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   FORM LAYOUT
======================================== */
.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
    .contact-form {
        padding: 3rem;
        border-radius: 1.5rem;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .form-group {
        margin-bottom: 2rem;
    }
}

/* ========================================
   FORM LABELS
======================================== */
.form-group label,
fieldset legend {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .form-group label,
    fieldset legend {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
}

.required {
    color: var(--error-color);
    font-weight: 700;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

fieldset legend {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    fieldset legend {
        font-size: 1.125rem;
        margin-bottom: 1.25rem;
    }
}

/* ========================================
   FORM INPUTS
======================================== */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 48px;
    font-family: inherit;
}

@media (min-width: 768px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 1rem;
        font-size: 1.0625rem;
        min-height: 52px;
    }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 134, 105, 0.1);
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .form-group textarea {
        min-height: 140px;
    }
}

/* ========================================
   RADIO GROUPS
======================================== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .radio-group {
        gap: 1rem;
    }
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

@media (min-width: 768px) {
    .radio-option {
        gap: 1rem;
        padding: 1rem;
        border-radius: 0.75rem;
    }
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: rgba(0, 134, 105, 0.05);
}

.radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(0, 134, 105, 0.1);
}

.radio-option:has(input:focus) {
    box-shadow: 0 0 0 3px rgba(0, 134, 105, 0.1);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    min-height: auto;
    accent-color: var(--primary-color);
    cursor: pointer;
}

@media (min-width: 768px) {
    .radio-option input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}

.radio-option label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .radio-option label {
        font-size: 1rem;
    }
}

/* ========================================
   CHECKBOX GROUPS
======================================== */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .checkbox-group {
        gap: 1rem;
        border-radius: 0.75rem;
    }
}

.checkbox-group:hover {
    border-color: var(--primary-color);
}

.checkbox-group:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(0, 134, 105, 0.05);
}

.checkbox-group:has(input:focus) {
    box-shadow: 0 0 0 3px rgba(0, 134, 105, 0.1);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    min-height: auto;
    accent-color: var(--primary-color);
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .checkbox-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}

.checkbox-group label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .checkbox-group label {
        font-size: 1rem;
    }
}

/* ========================================
   HELP TEXT & ERRORS
======================================== */
.help-text {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .help-text {
        font-size: 0.875rem;
        margin-top: 0.375rem;
    }
}

.error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .error-message {
        font-size: 0.875rem;
        margin-top: 0.375rem;
    }
}

.error-message:before {
    content: '⚠ ';
    margin-right: 0.25rem;
}

/* ========================================
   CHARACTER COUNTER
======================================== */
.character-counter {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    text-align: right;
    font-weight: 500;
}

@media (min-width: 768px) {
    .character-counter {
        font-size: 0.875rem;
        margin-top: 0.375rem;
    }
}

.character-counter.warning {
    color: var(--warning-color);
}

.character-counter.error {
    color: var(--error-color);
    font-weight: 500;
}

/* ========================================
   FORM ACTIONS
======================================== */
.form-actions {
    margin-top: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .form-actions {
        margin-top: 2.5rem;
    }
}

.form-note {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .form-note {
        font-size: 0.875rem;
        margin-top: 1.25rem;
    }
}

.form-note i {
    color: var(--success-color);
}

/* ========================================
   BUTTON LOADING STATES
======================================== */
.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ========================================
   SUCCESS MESSAGE
======================================== */
.form-success {
    background: var(--bg-card);
    border: 2px solid var(--success-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
    .form-success {
        padding: 4rem 3rem;
        border-radius: 1.5rem;
    }
}

.success-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .success-icon {
        font-size: 4rem;
        margin-bottom: 1.5rem;
    }
}

.form-success h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .form-success h3 {
        margin-bottom: 1.5rem;
        font-size: 2rem;
    }
}

.form-success p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .form-success p {
        font-size: 1.125rem;
        margin-bottom: 2.5rem;
    }
}

/* ========================================
   ERROR ALERTS
======================================== */
.form-error-alert {
    background: #fef2f2;
    border: 2px solid var(--error-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (prefers-color-scheme: dark) {
    .form-error-alert {
        background: rgba(239, 68, 68, 0.1);
    }
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.error-content i {
    color: var(--error-color);
    font-size: 1.25rem;
}

.error-content span {
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
}

.error-close {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-close:hover {
    background: rgba(239, 68, 68, 0.1);
}

.error-close:focus {
    outline: 2px solid var(--error-color);
    outline-offset: 2px;
}

/* ========================================
   FAQ SECTION
======================================== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .faq-item {
        border-radius: 1rem;
        margin-bottom: 1.5rem;
    }
}

.faq-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.25rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 48px;
}

@media (min-width: 768px) {
    .faq-question {
        padding: 1.5rem;
        font-size: 1.125rem;
        min-height: 56px;
    }
}

.faq-question:hover {
    background: rgba(0, 134, 105, 0.05);
}

.faq-question:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.faq-question i {
    color: var(--primary-color);
    transition: transform 0.3s ease;
    font-size: 1rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .faq-question i {
        font-size: 1.125rem;
    }
}

.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.faq-answer p {
    padding: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .faq-answer p {
        padding: 1.5rem;
        font-size: 1rem;
    }
}

/* CSS for pre-selected form elements - Add to contact-form.css */

/* Preselected radio option animation */
.radio-option.preselected {
    animation: preselectPulse 2s ease-out;
    border-color: var(--primary-color);
    background: rgba(0, 134, 105, 0.15);
}

/* Prefilled input field animation */
.form-group input.prefilled,
.form-group textarea.prefilled {
    animation: prefillHighlight 2s ease-out;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 134, 105, 0.1);
}

/* Pulse animation for preselected elements */
@keyframes preselectPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 134, 105, 0.7);
    }
    25% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(0, 134, 105, 0.3);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 0 4px rgba(0, 134, 105, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 134, 105, 0);
    }
}

/* Highlight animation for prefilled fields */
@keyframes prefillHighlight {
    0% {
        background-color: rgba(0, 134, 105, 0.1);
    }
    50% {
        background-color: rgba(0, 134, 105, 0.05);
    }
    100% {
        background-color: transparent;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .radio-option.preselected,
    .form-group input.prefilled,
    .form-group textarea.prefilled {
        animation: none;
    }
    
    .radio-option.preselected {
        border-color: var(--primary-color);
        background: rgba(0, 134, 105, 0.1);
    }
    
    .form-group input.prefilled,
    .form-group textarea.prefilled {
        border-color: var(--primary-color);
    }
}

/* ========