/* Enhanced Wizard System v2.0 Styles */

/* Auto-save indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.auto-save-indicator i {
    margin-right: 8px;
}

/* Draft recovery prompt */
.draft-recovery {
    margin: 20px 0;
    animation: slideDown 0.3s ease;
}

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

/* State requirements notice */
.state-requirements-notice {
    margin-bottom: 20px;
    border-left: 4px solid #0056b3;
}

.state-requirements-notice i {
    margin-right: 10px;
    color: #0056b3;
}

/* Required field indicators */
.required-indicator {
    color: #dc3545;
    font-weight: bold;
    margin-left: 4px;
}

/* Enhanced form validation */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .wizard-step {
        min-width: 70px;
        font-size: 0.85rem;
    }
    
    .wizard-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .wizard-container {
        padding: 10px;
    }
    
    .wizard-form-section,
    .step-content {
        padding: 15px;
    }
    
    input, textarea, select, button {
        min-height: 44px !important;
        font-size: 16px !important;
    }
    
    .auto-save-indicator {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 0.875rem;
    }
}

/* Accessibility enhancements */
.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;
}

.wizard-step:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
    border-color: #0056b3;
}

/* Progress animations */
.wizard-progress-bar,
.progress-fill {
    transition: width 0.4s ease;
}

/* Step transitions */
.wizard-form-section,
.step-content {
    animation: fadeIn 0.3s ease;
}

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

/* Enhanced button states */
.btn-next:disabled,
.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Touch-friendly spacing */
.form-group,
.mb-3 {
    margin-bottom: 1.5rem;
}

/* Smart field enhancements */
input[data-format="phone"],
input[data-format="currency"],
input[data-format="ssn"] {
    font-family: 'Courier New', monospace;
}

/* Loading states */
button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wizard-step.active {
        border: 3px solid currentColor;
    }
    
    .form-control:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auto-save-indicator {
        background: #20c997;
    }
    
    .state-requirements-notice {
        background-color: #1e2937;
        border-left-color: #60a5fa;
    }
}
