/* Estilos de validación de formularios modernos */

/* Estados de validación para inputs */
.form-group input.valid,
.form-group select.valid {
    border-color: var(--success-green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-group input.invalid,
.form-group select.invalid {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Iconos de validación */
.form-group input.valid::after,
.form-group select.valid::after {
    content: '✓';
    position: absolute;
    right: 12px;
    color: var(--success-green);
    font-weight: bold;
}

/* Mensajes de error */
.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progreso del formulario */
.form-progress {
    width: 100%;
    height: 4px;
    background: var(--neutral-gray-100);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.form-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--secondary-green) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Tooltips para ayuda */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--neutral-gray-900);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--neutral-gray-900) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Loading spinner para formularios */
.loading-spinner {
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Estilos para steps/pasos */
.steps-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--neutral-gray-100);
    color: var(--neutral-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary-blue);
    color: white;
}

.step.completed .step-number {
    background: var(--secondary-green);
    color: white;
}

.step-title {
    font-size: 0.875rem;
    color: var(--neutral-gray-600);
    text-align: center;
    font-weight: 500;
}

.step.active .step-title {
    color: var(--primary-blue);
    font-weight: 600;
}

.step.completed .step-title {
    color: var(--secondary-green);
}

/* Línea conectora entre steps */
.step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: var(--neutral-gray-100);
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step.completed::after {
    background: var(--secondary-green);
}

/* Responsive para steps */
@media (max-width: 640px) {
    .steps-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .step::after {
        display: none;
    }
    
    .step {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .step-number {
        margin-right: 1rem;
        margin-bottom: 0;
    }
}

/* Autocomplete styling */
.autocomplete-suggestions {
    background: white;
    border: 1px solid var(--neutral-gray-200);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 1000;
    margin-top: 4px;
}

.autocomplete-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--neutral-gray-100);
    transition: background-color 0.2s ease;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: var(--primary-50);
    color: var(--primary-700);
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

/* Checkbox y radio styling moderno */
.modern-checkbox,
.modern-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.modern-checkbox input[type="checkbox"],
.modern-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark,
.radiomark {
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid var(--neutral-gray-300);
    border-radius: 4px;
    margin-right: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radiomark {
    border-radius: 50%;
}

.modern-checkbox:hover .checkmark,
.modern-radio:hover .radiomark {
    border-color: var(--primary-blue);
}

.modern-checkbox input:checked ~ .checkmark,
.modern-radio input:checked ~ .radiomark {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modern-checkbox input:checked ~ .checkmark::after {
    opacity: 1;
}

.radiomark::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modern-radio input:checked ~ .radiomark::after {
    opacity: 1;
}
