/* Forms Frontend Styles */

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        margin: 1rem;
        border-radius: 10px;
    }
    
    .form-header {
        padding: 2rem 1rem;
    }
    
    .form-header h1 {
        font-size: 2rem;
    }
    
    .form-body {
        padding: 2rem 1rem;
    }
    
    .question-group.indented {
        margin-left: 1rem;
    }
    
    .question-group.double-indented {
        margin-left: 2rem;
    }
    
    .btn-submit {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .form-header h1 {
        font-size: 1.75rem;
    }
    
    .form-header p {
        font-size: 1rem;
    }
    
    .question-group {
        padding: 1rem;
    }
    
    .page-section {
        padding: 1rem;
    }
}

/* Enhanced Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Custom Radio and Checkbox Styles */
.radio-group .form-check,
.checkbox-group .form-check {
    margin-bottom: 0.5rem;
}

.radio-group .form-check:last-child,
.checkbox-group .form-check:last-child {
    margin-bottom: 0;
}

/* Rating Styles */
.rating-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.rating-group .form-check-inline {
    margin-right: 0;
}

/* Multi-select Styles */
select[multiple] {
    min-height: 120px;
}

/* Loading States */
.btn-loading {
    display: none;
}

.btn:disabled .btn-loading {
    display: inline-block;
}

.btn:disabled .btn-text {
    display: none;
}

/* Error States */
.is-invalid {
    border-color: #dc3545 !important;
}

.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success States */
.is-valid {
    border-color: #28a745 !important;
}

.is-valid:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(102, 126, 234, 0.1);
    z-index: 9999;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Accessibility Improvements */
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-container {
        border: 2px solid #000;
    }
    
    .question-group {
        border: 1px solid #000;
    }
    
    .btn-submit {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .form-control,
    .form-select,
    .btn-submit,
    .question-group {
        transition: none;
    }
    
    .fade-in,
    .slide-in {
        animation: none;
    }
}

/* Question Number Styles */
.question-number {
    display: inline-block;
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
}

.question-group {
    position: relative;
}

.question-title {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

/* Print Styles */
@media print {
    .form-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn-submit,
    .btn-primary,
    .btn-secondary {
        display: none;
    }
    
    .question-group {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .question-number {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
} 