/* Estilos adicionales para mejoras de UX */

/* Animaciones */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Validaciones de campos */
.field-error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

.field-warning {
    border-color: #d69e2e !important;
    box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.1) !important;
}

.field-info {
    border-color: #3182ce !important;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1) !important;
}

.field-validation {
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.field-validation-error {
    background-color: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.field-validation-warning {
    background-color: #fefcbf;
    color: #b7791f;
    border: 1px solid #f6e05e;
}

.field-validation-info {
    background-color: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

/* Hints de cálculo */
.calculation-hint {
    font-size: 11px;
    color: #8BC53F;
    font-style: italic;
    margin-top: 3px;
    padding: 3px 8px;
    background-color: #f0f8e8;
    border-radius: 3px;
    border-left: 3px solid #8BC53F;
}

/* Barra de progreso */
.progress-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.progress-container.progress-complete {
    background: #f0f8e8;
    border-color: #8BC53F;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8BC53F, #7ba82f);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.progress-complete .progress-text {
    color: #8BC53F;
    font-weight: 600;
}

/* Alertas del formulario */
.form-alert {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
    animation: slideDown 0.3s ease-out;
}

.form-alert h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.form-alert ul {
    margin: 0;
    padding-left: 20px;
}

.form-alert li {
    margin-bottom: 8px;
}

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

/* Overlay de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #8BC53F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content h3 {
    color: #2c5282;
    margin-bottom: 10px;
}

.loading-content p {
    color: #666;
    margin: 0;
}

/* Mejoras en los tooltips */
.help-text {
    position: relative;
    cursor: help;
}

.help-text:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.help-text:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Mejoras en los inputs con focus */
input:focus,
select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 197, 63, 0.15) !important;
}

/* Estados de los botones */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Mejoras responsive adicionales */
@media (max-width: 480px) {
    .loading-content {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .progress-container {
        padding: 15px;
    }
    
    .form-alert {
        padding: 15px;
    }
}

/* Estilos para campos requeridos */
input:required:invalid {
    box-shadow: none;
}

input:required:valid {
    border-color: #68d391;
}

/* Animación para campos que aparecen/desaparecen */
.form-group {
    transition: all 0.3s ease;
}

.form-group.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Mejoras en la accesibilidad */
.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 visible para navegación por teclado */
*:focus-visible {
    outline: 2px solid #8BC53F;
    outline-offset: 2px;
}

/* Estilos para el modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .calculation-hint {
        background-color: rgba(139, 197, 63, 0.1);
        color: #a3d977;
    }
    
    .progress-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .progress-bar {
        background-color: #4a5568;
    }
}

/* Animaciones de entrada para las secciones */
.form-section {
    animation: slideInUp 0.6s ease-out;
}

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

/* Delay para animaciones escalonadas */
.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.2s; }

/* Estilos para campos con autocompletado */
input[list] {
    position: relative;
}

input[list]::-webkit-calendar-picker-indicator {
    display: none;
}

/* Mejoras en los mensajes de error */
.alert-danger {
    border-left: 4px solid #e53e3e;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

