/* Modal mejorado */
.afocat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.afocat-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.afocat-modal-dialog {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: 30px auto;
    z-index: 100000;
}

.afocat-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.afocat-modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.afocat-modal-title {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.afocat-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afocat-modal-close:hover {
    color: #333;
}

.afocat-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.afocat-modal-footer {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

/* Resultados */
.afocat-resultado-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.afocat-resultado-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
}

.afocat-resultado-header h4 {
    margin: 0;
    color: #333;
}

.afocat-resultado-body {
    padding: 20px;
}

.afocat-resultado-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.afocat-resultado-col {
    flex: 1;
    min-width: 250px;
    padding: 0 10px;
    margin-bottom: 15px;
}

.afocat-resultado-col p {
    margin: 0 0 10px 0;
}

.afocat-resultado-col strong {
    color: #555;
    min-width: 100px;
    display: inline-block;
}

/* Alertas */
.afocat-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.afocat-alert-content {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    padding: 15px;
    position: relative;
}

.afocat-alert-error {
    border-left: 4px solid #dc3545;
}

.afocat-alert-success {
    border-left: 4px solid #28a745;
}

.afocat-alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afocat-alert-close:hover {
    color: #333;
}

.afocat-alert p {
    margin: 0;
    padding-right: 20px;
}

/* Estados */
.estado-vigente {
    color: #28a745;
    font-weight: bold;
}

.estado-vencido {
    color: #dc3545;
    font-weight: bold;
}

.estado-desconocido {
    color: #6c757d;
    font-style: italic;
}

/* Formulario */
.afocat-form-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.afocat-form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
    z-index: 1;
}

.afocat-form-divider span {
    display: inline-block;
    background: #fff;
    padding: 0 15px;
    position: relative;
    z-index: 2;
    color: #6c757d;
}

.afocat-help-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.875rem;
}

.afocat-form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 768px) {
    .afocat-modal-dialog {
        width: 95%;
        margin: 10px auto;
    }
    
    .afocat-resultado-col {
        flex: 100%;
    }
    
    .afocat-alert {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}