/* Validation Styles for Health Screening Questionnaire */

.validation-input {
    transition: all 0.3s ease;
    border: 1px solid #d1d5db;
}

.validation-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-text.invalid {
    border-color: #ef4444;
    background-color: #fff5f5;
}

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.text-gray-500 {
    color: #6b7280;
}

.mt-1 {
    margin-top: 0.25rem;
}

.block {
    display: block;
}

.validation-input.border-red-500 {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.validation-input.border-green-500 {
    border-color: #22c55e;
    background-color: #f0fdf4;
}

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

.validation-input.border-green-500:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    animation: fadeIn 0.3s ease;
}

.success-message {
    color: #22c55e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Loading overlay styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Form validation summary */
.validation-summary {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.validation-summary h4 {
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.validation-summary ul {
    list-style-type: none;
    padding: 0;
}

.validation-summary li {
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Required field indicator */
.required-field::after {
    content: " *";
    color: #ef4444;
}

/* Radio button validation */
.radio-group.error {
    border: 1px solid #ef4444;
    border-radius: 4px;
    padding: 0.5rem;
    background-color: #fef2f2;
}

/* Select validation */
select.validation-input.border-red-500 {
    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='%23ef4444' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Date input validation */
input[type="date"].validation-input {
    position: relative;
}

input[type="date"].validation-input.border-red-500::-webkit-calendar-picker-indicator {
    filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(86deg) brightness(118%) contrast(119%);
}

/* Responsive validation */
@media (max-width: 768px) {
    .error-message {
        font-size: 0.75rem;
    }
}

.age-display {
  font-weight: normal;
  font-size: 0.9em;
  color: #6b7280;
}