/* ============================================= */
/* PROVEEDORES.CSS - ESTILOS PARA FORMULARIOS   */
/* ============================================= */

/* Estilos específicos para la página de proveedores */
.proveedores-container {
    max-width: 900px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.proveedores-container h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Pasos del formulario */
.form-paso {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.form-paso.active {
    display: block;
}

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

/* Selector de tipo de persona mejorado */
.tipo-persona-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tipo-option {
    border: 3px solid #e9ecef;
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.tipo-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tipo-option:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.2);
}

.tipo-option:hover::before {
    transform: scaleX(1);
}

.tipo-option.selected {
    border-color: #27ae60;
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.tipo-option.selected::before {
    background: linear-gradient(90deg, #27ae60, #219a52);
    transform: scaleX(1);
}

.tipo-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.tipo-option h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.tipo-option p {
    color: #7f8c8d;
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Botón volver */
.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    background: #7f8c8d;
    transform: translateX(-5px);
}

/* Formularios */
.proveedor-form {
    display: none;
    animation: slideIn 0.5s ease-in-out;
}

.proveedor-form.active {
    display: block;
}

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

.proveedor-form h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #ecf0f1;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.form-group label::after {
    content: ' *';
    color: #e74c3c;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #bdc3c7;
}

.form-group input[type="file"] {
    padding: 0.8rem;
    background: #f8f9fa;
    border: 2px dashed #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.form-group input[type="file"]:focus {
    border-style: solid;
    border-color: #3498db;
}

.file-group small {
    display: block;
    margin-top: 0.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Mensajes de validación */
.validation-msg {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.validation-msg.error {
    background: #ffeaea;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.validation-msg.success {
    background: #eaffea;
    color: #27ae60;
    border: 1px solid #27ae60;
}

/* Sección de anexos */
.anexos-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 3rem 0;
    border-left: 6px solid #3498db;
    position: relative;
}

.anexos-section::before {
    content: '📎';
    position: absolute;
    top: -15px;
    left: -15px;
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.anexos-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Botón de envío */
.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #219a52, #1e8449);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn:disabled:hover::before {
    left: -100%;
}

/* Estados de validación */
.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group select:invalid:not(:focus) {
    border-color: #e74c3c;
    background: #ffeaea;
}

.form-group input:valid:not(:focus):not(:placeholder-shown),
.form-group select:valid:not(:focus) {
    border-color: #27ae60;
    background: #eaffea;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .proveedores-container {
        margin: 1rem auto;
        padding: 1.5rem;
        border-radius: 8px;
    }
    
    .proveedores-container h1 {
        font-size: 1.8rem;
    }
    
    .tipo-persona-selector {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tipo-option {
        padding: 2rem 1.5rem;
    }
    
    .tipo-icon {
        font-size: 3rem;
    }
    
    .anexos-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .back-btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .proveedor-form h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .proveedores-container {
        padding: 1rem;
        margin: 0.5rem auto;
        border-radius: 6px;
    }
    
    .proveedores-container h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .tipo-option {
        padding: 1.5rem 1rem;
    }
    
    .tipo-icon {
        font-size: 2.5rem;
    }
    
    .tipo-option h3 {
        font-size: 1.2rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
    
    .anexos-section {
        padding: 1rem;
    }
    
    .anexos-section::before {
        width: 35px;
        height: 35px;
        top: -12px;
        left: -12px;
        font-size: 1rem;
    }
    
    .submit-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .form-paso,
    .proveedor-form,
    .tipo-option,
    .submit-btn,
    .back-btn {
        animation: none;
        transition: none;
    }
}

/* Focus visible para mejor accesibilidad */
.form-group input:focus-visible,
.form-group select:focus-visible,
.submit-btn:focus-visible,
.back-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Estados de error mejorados */
.form-group.error input,
.form-group.error select {
    border-color: #e74c3c;
    background: #ffeaea;
}

.form-group.success input,
.form-group.success select {
    border-color: #27ae60;
    background: #eaffea;
}

/* Tooltips informativos */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Mejoras para campos de archivo */
.file-group {
    position: relative;
}

.file-group input[type="file"]::file-selector-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 1rem;
    transition: background 0.3s ease;
}

.file-group input[type="file"]::file-selector-button:hover {
    background: #2980b9;
}