 /* Tus estilos existentes se mantienen igual */
.dase-container { 
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 15px;
    font-family: 'Montserrat', sans-serif;
}
    
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.form-group {
    margin-bottom: 15px;
    display: flex; flex-direction: column;
}

.form-group label {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #1e2b3c;
}

.form-group input, .form-group select, .form-group textarea { 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 8px; 
    font-size: 1rem; 
    width: 100%;
}

.map-box { 
    height: 400px; 
    border: 2px solid #3498db; 
    border-radius: 12px; 
    margin: 10px 0; 
    z-index: 1;
}

.btn-submit { 
    background: #3498db;
    color: white;
    padding: 18px;
    border: none;
    border-radius: 8px; 
    font-weight: 800; 
    cursor: pointer; 
    width: 100%; 
    transition: 0.3s;
    font-size: 1.1rem;
}
    
.btn-submit:hover { 
    background: #2980b9; 
}

.hidden-field { 
    display: none; 
}
    
.section-title {
    border-left: 5px solid #f5b01b; 
    padding-left: 10px;
    margin: 25px 0 15px;
    color: #1a2b3c;
}
    
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}
    
.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}
    
.close-modal {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}
    
.close-modal:hover {
    color: #333;
}
    
.btn-unidad {
    background: #f5b01b;
    color: #1a2b3c;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}
    
.btn-unidad:hover {
    background: #e09e0c;
}
    
.filtros-unidades {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
    
.lista-unidades {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}
    
.item-unidad {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}
    
.item-unidad:hover {
    background: #f0f7ff;
}
    
.item-unidad.selected {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
}
    
.item-unidad .nombre {
    font-weight: bold;
    color: #1a2b3c;
}
    
.item-unidad .detalle {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}
    
.badge-canton {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}
    
.btn-representante {
    background: #f5b01b;
    color: #1a2b3c;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}
    
.btn-representante:hover {
    background: #e09e0c;
}
    
.unidad-seleccionada {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #4CAF50;
    margin-top: 10px;
}
    
.password-requirements {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}
    
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}
    
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}
    
.debug-console {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    font-family: monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
    
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .dase-container { margin: 1rem auto; }
    .map-box { height: 300px; }
    .filtros-unidades { grid-template-columns: 1fr; }
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.loading-overlay.active {
    display: flex;
}
.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #f5b01b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
.loading-text {
    color: white;
    font-size: 18px;
    font-weight: bold;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-submit .spinner-small {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}
.btn-submit.loading .spinner-small {
    display: inline-block;
}

/* Estilos para el mÃ³dulo de representantes */
.rep-existe, .rep-nuevo, .rep-error {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
}

.rep-existe {
    border: 2px solid #2ecc71;
    background: #e8f5e9;
}

.rep-nuevo {
    border: 2px solid #e67e22;
    background: #fff3e0;
}

.rep-error {
    border: 2px solid #e74c3c;
    background: #ffebee;
}

.btn-vincular, .btn-registrar-nuevo {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.btn-vincular {
    background: #2ecc71;
    color: white;
}

.btn-registrar-nuevo {
    background: #e67e22;
    color: white;
}

.rep-vinculado {
    display: block;
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin: 10px 0;
}

.campos-nuevo-representante {
    background: #fff8e1;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #ff9800;
}

.alert-message {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/**
 * DASE Form - Estilos para Representantes Legales
 * Archivo: dase-form-representante.css
 */

/* Modal de representante */
#modal-representante {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

#modal-representante .modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

#modal-representante .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f5b01b;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#modal-representante .modal-header h3 {
    margin: 0;
    color: #1a2b3c;
}

#modal-representante .close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

#modal-representante .close-modal:hover {
    color: #333;
}

#modal-representante .modal-footer {
    margin-top: 20px;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* Resultados de b¨²squeda */
.rep-existe {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #2ecc71;
    background: #e8f5e9;
    border-radius: 8px;
}

.rep-nuevo {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #e67e22;
    background: #fff3e0;
    border-radius: 8px;
}

.rep-error {
    margin-top: 15px;
    padding: 15px;
    border: 2px solid #e74c3c;
    background: #ffebee;
    border-radius: 8px;
}

.btn-vincular, .btn-registrar-nuevo {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.btn-vincular {
    background: #2ecc71;
    color: white;
}

.btn-registrar-nuevo {
    background: #e67e22;
    color: white;
}

/* Campos nuevo representante */
.campos-nuevo-representante {
    background: #fff8e1;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #ff9800;
}

.campos-nuevo-representante .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.rep-vinculado {
    display: block;
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin: 10px 0;
}

.info-representante {
    margin: 10px 0;
}

/* Loading spinner */
.loading-spinner-small {
    text-align: center;
    padding: 20px;
}

.loading-spinner-small .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f5b01b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}